Posts for high order

Writing cleaner code with higher-order functions

Higher-order functions in JavaScript simply put are functions that either return another function or take another function as an argument. There are built-in higher-order functions in JavaScript which we’ll be looking at in a bit, first, let’s look at the simplest example of a higher-order function: const add = (x)=>(y)=> x + y; As you […]

December 11, 2019 in Javascript & Tutorials

An in-depth view of Higher-Order functions

Introduction As complex as it may seem, higher-order functions are functions that either accepts a function as an argument or returns a function or does both. This is possible because, in JavaScript, functions are first-class citizens — they are treated as variables and can be passed as arguments to other functions and returned by other […]

December 5, 2019 in Javascript & Tutorials