News for hackers. Stuff that matters.
Re:Functional JavaScript, Part 3: apply, call, and the argum... by stankalank on Tuesday April 22, 2014 @03:03PM (#7629651)
I found your section on converting prototype methods into utility functions really interesting, I found myself doing the same thing a few days ago. One suggestion for your 'demethodize' function is to replace the prototype methods you use with purely functional versions (AKA replace [].slice and fn.apply). It seems kind of funky to have a function dedicated to demethodizing prototype methods that makes use of prototype methods!
Re:Functional JavaScript, Part 3: apply, call, and the argum... by lrichardson on Tuesday April 22, 2014 @03:12PM (#7629704)
Yeah, I think I sometimes weave back-and-forth. I try to avoid thinking about "micro-optimizations", but can't help myself. As I'm writing this series I'm compiling together a small and opinionated library that uses a lot of these concepts, and I am tending to use native methods, for loops, while loops etc. in favor of performance....

but I should probably stop that and instead favor the clean code following the very principles they are there to promote! One of my points was that performance doesn't really matter here anyway.

Thanks for pointing out. I might update a couple spots.