Tell us what’s happening:
Describe your issue in detail here.
The code below is provided by free code camp does not work can u tell me the reason why is it not working?
[spoiler]
/**
* A long process to prepare green tea.
* @return {string} A cup of green tea.
**/
const prepareGreenTea = () => "greenTea";
/**
* Get given number of cups of tea.
* @param {function():string} prepareTea The type of tea preparing function.
* @param {number} numOfCups Number of required cups of tea.
* @return {Array<string>} Given amount of tea cups.
**/
const getTea = (prepareTea, numOfCups) => {
const teaCups = [];
for (let cups = 1; cups <= numOfCups; cups += 1) {
const teaCup = prepareTea();
teaCups.push(teaCup);
}
return teaCups;
};
// Add your code below this line
const tea4GreenTeamFCC = getTea(prepareGreenTea, 27); // :)
const tea4BlackTeamFCC = getTea(prepareBlackTea, 13); // :)
// Add your code above this line
[/spoiler]
Challenge: Understand Functional Programming Terminology
Link to the challenge:
