Higher Order Function
const square = function (num) { // Function expression assigning a function to variable square return num * num; }; // Since the variable square is assigned a function, it's a first-class object, and you can use the function call operator () output = square(7);const cat = { name: 'nabi', age: 3, cry: function () { console.log('miaow..'); }, };
2. Understanding Higher Order Functions
3. Built-in Higher Order Functions
Last updated