- script.js
JavaScript
var collectContainer = function () {
var food = 'pasta';
var eatDinner = function () {
console.log('I ate ' + food);
};
return eatDinner;
};
Result
Goalscompleted
- After the
collectContainerfunction is defined, create a variableschoolkid. - Assign the return value of the
collectContainerfunction call to theschoolkidvariable. - After that, output the
schoolkidvariable to the console. - After that call the resulting function:
schoolkid().
Comments