Does my understanding about first class, higher order and lambda correct base on the comments I make on this problem?

Just making sure to understand it well, thanks for replies.

Your code so far

//This are lambda
const prepareGreenTea = () => 'greenTea';
const prepareBlackTea = () => 'blackTea';
//This one is a first class since it was declared as a variable
const getTea = (prepareTea, numOfCups) => {
const teaCups = [];
for(let cups = 1; cups <= numOfCups; cups += 1) {
const teaCup = prepareTea();
teaCups.push(teaCup);
}
return teaCups;
};
//Then this one is higher order functions as the getTea function accepts a function as an argument
const tea4GreenTeamFCC = getTea(prepareGreenTea, 27);
const tea4BlackTeamFCC = getTea(prepareBlackTea, 27);
console.log(
tea4GreenTeamFCC,
tea4BlackTeamFCC
);

In terms of a first-class functions, it simply means that a language (such as JavaScript) provides a behavior to its functions very much like how we intend to use a variable, i.e. assign it to a variable, argument to a function, or return it as value from a function call.

For the higher-order function, you got it correctly, because a higher-order function is a function that accepts one/more functions as an argument and/or return it as a value after a function call.

Thank you for replying @arantebillywilson! It’s a little bit confusing but this is surely why I need to read more about this topic and look some examples. Thank you, I appreciate it!