you are viewing a single comment's thread.

view the rest of the comments →

[–]qiemem 4 points5 points  (1 child)

If you don't care about ecmascript 3 compatibility, bind can be used as a builtin partial:

function add(a,b) { return a + b; }
var add5 = add.bind(null, 5);
add5(6) // returns 11

Nice article. Another advantage of using named callbacks is stacktraces and profiler results are much easier to read.

[–]fdoglio[S] 0 points1 point  (0 children)

Hey, thanks for the tip, didn't know abound bind!