JS First-class functions & call, apply and bind methods

First-class function

A function can simply be treated as variable. This makes a function return another function and hence the returned function can be called anywhere down the line. Let’s take a simple example:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store