Higher-order function: Difference between revisions

Content deleted Content added
m JavaScript: Added a more legible equivalent to the arrow-function syntax, for non-Js users.
DarthKitty (talk | contribs)
Line 423:
 
With arrow functions:
 
<syntaxhighlight lang="javascript">
"use strict";
Line 436 ⟶ 437:
 
Or with classical syntax:
 
<syntaxhighlight lang="javascript">
"use strict";
Line 443 ⟶ 445:
return f(f(x));
};
};
 
function plusThree(i) {
Line 450 ⟶ 452:
 
const g = twice(plusThree);
 
console.log(g(7)); // 13
</syntaxhighlight>