Javascript function application / currying / callbacks

Javascript partial functions:Here, doSomething is a callback and the second argument should be data from a JQuery ajax call.Say you have a function:


There can be any number of arguments after passing in the function argument, like: partial(fn, arg1, arg2, …, argn), these arguments are applied to the function you will be calling.


 

The callback after the post will behave just like you called: doSomething(“Test Value”, data) where data is the $.post result.

 

Leave a Reply

Your email address will not be published. Required fields are marked *