function candies(children, candy) {
// Alternative Solution without Math package
// Use the modulus operator % to find the remainder of candy after divided evenly between
chilren
// Subtract the remainder (which can't be eaten) from the original candy count
return (candy - (candy % children))
}
/**
* Test Suite
*/
describe('candies()', () => {
it('returns ammount of total equal candy to be eaten', () => {
// arrange
const children = 3;
const candy = 10;
// act
const result = candies(children, candy);
// log
console.log("result: ", result);
// assert
expect(result).toBe(9);
});
});