javascript bind & currying

Javascript bind is really useful to help

a) resolving this keyword and issues

b) currying

lets look at a very simple scenario. We would like to create a method that uses "this" keyword. Next we are going to invoke it via "bind" and shows us how it is done.

Next, we will look at currying.

Currying gives you the ability to defer from providing all arguments when trying to invoke a function.  So you can provide one and then the next argument.

Lets see this in our next example.


Popular posts from this blog

ionic2 cordova build android - Unable resolve gradle 2.2.3

A quick tutorial for OWASP ZAP tool for beginners