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.




Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm