News for hackers. Stuff that matters.
Re:Using Dispatch Tables to Avoid Conditionals in JavaScript by xhrpost on Monday May 13, 2013 @12:06PM (#5699461)
It's just a way of getting rid of the redundant "function()" syntax. Unfortunately with bind(), we have to set the scope even though it isn't always necessary. So in this case, the first parameter "this" is also probably redundant. The old PrototypeJS curry() would have been the least redundant solution: movePlayer.curry("north")
Re:Using Dispatch Tables to Avoid Conditionals in JavaScript by k3n on Monday May 13, 2013 @12:52PM (#5699770)
Re:Using Dispatch Tables to Avoid Conditionals in JavaScript by malandrew on Monday May 13, 2013 @02:24PM (#5700454)
It would be nice if they had called it curry() or at least created a curry() alias.
Re:Using Dispatch Tables to Avoid Conditionals in JavaScript by xhrpost on Monday May 13, 2013 @01:14PM (#5699925)
Nice, hadn't seen that before, looks like it was just added early this year.