Functional Programming - Understand Functional Programming Terminology

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

// Function that returns a string representing a cup of green tea
const prepareGreenTea = () => 'greenTea';

// Function that returns a string representing a cup of black tea
const prepareBlackTea = () => 'blackTea';

/*
Given a function (representing the tea type) and number of cups needed, the
following function returns an array of strings (each representing a cup of
a specific type of tea).
*/
const getTea = (prepareTea, numOfCups) => {
  const teaCups = [];

  for(let cups = 1; cups <= numOfCups; cups += 1) {
    const teaCup = prepareTea();
    teaCups.push(teaCup);
  }
  return teaCups;
};

// Only change code below this line
const tea4GreenTeamFCC = null;
const tea4BlackTeamFCC = null;
// Only change 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/118.0.0.0 YaBrowser/23.11.0.0 Safari/537.36

Challenge Information:

Functional Programming - Understand Functional Programming Terminology

Hello everyone, are there similar topics but with normal explanations? Where do they show in detail and with examples what it is and why it is needed? Otherwise, of the given 5%, it is not clear what it is?

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

Hi @masha2

The instructions want you to pass a function with arguments, for each tea.

Happy coding

And HOW to understand where there are examples? what to refer to? and most importantly, how to write it down?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.