News for hackers. Stuff that matters.
Re:Default Parameters in JavaScript by yuchi on Tuesday March 19, 2013 @01:20PM (#5402225)
I'm not talking about single occurence of the "bad" pattern. If you multiple it to the occurence in a whole code base... well you get the point. That's why underscore and coffee-script treat default assignement that way.
Re:Default Parameters in JavaScript by STRML on Thursday March 21, 2013 @01:09PM (#5416844)
Interestingly, in JSPerf, sometimes the ternary pattern is actually faster than the if statement. Must be something V8 is doing.