Https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/functional-programming/understand-functional-programming-terminology

Tell us what’s happening:

Your code so far


const prepareGreenTea = () => "greenTea";
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

console.log(tea4GreenTeamFCC, tea4BlackTeamFCC);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36.

Challenge: Understand Functional Programming Terminology

Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/functional-programming/understand-functional-programming-terminology

what’s going wrong? what help do you need?

plase help the problem is :-

// running tests The

tea4GreenTeamFCC

variable should hold 27 cups of green tea for the team. The

tea4GreenTeamFCC

variable should hold cups of green tea. The

tea4BlackTeamFCC

variable should hold 13 cups of black tea. The

tea4BlackTeamFCC

variable should hold cups of black tea. // tests completed // console output ReferenceError: prepareBlackTea is not defined

And that very last bit is a good clue as to exactly what’s going on. You’ve modified the code from the original, removing the const prepareBlackTea line.

You may want to revert to the original, and simply modify the lines between the edit below and edit above. The point to this lesson is to understand how to pass in a callback function. There are two: prepareGreenTea() and prepareBlackTea(). Both have been prepared for you, this lesson asks you to pass them into a function as a callback.

It’s a great idea to tinker with the lessons, to try different approaches to see what happens, but in order to pass the tests, there are very specific things being tested for. So, if you remove parts the test is looking for, be sure to put them back in after. :wink: