scrimba
Note at 0:05
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Note at 0:05
Expand for more info
main.js
run
preview
console
function candies(children, candy) {
// write code here.
num = Math.floor(candy/children)
num = num * num
return num
}



/**
* 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);
});
});
Console
"result: "
,
9
,
/index.html
LIVE