[deleted]
Re:How Good C# Habits can Encourage Bad JavaScript Habits
by k3n on Thursday May 09, 2013 @05:44PM
(#5683166)
You're misinterpreting the results.
> operations per second (higher is better)
Using `new` is in red, while using `Object.create` is in blue, and the red bars are markedly larger than the blue in all but a few cases.
Thus, using `new` is, for the most part, much faster than the Crockford way. In Chrome, it's tons faster.
Re:How Good C# Habits can Encourage Bad JavaScript Habits
by stoey on Thursday May 09, 2013 @05:56PM
(#5683236)
That's not actually what the Crockford link says [1] it talks about using array and object literals in place of `new Object()` or `new Array()`. Which does indeed seem faster [2].
[1] http://yuiblog.com/blog/2006/11/13/javascript-we-hardly-new-... [2] http://jsperf.com/new-vs-object-literal