r/javascript • • Sep 06 '12

JavaScript Tricks You May Not Know

http://www.learncomputer.com/javascript-tricks-you-may-not-know/
0 Upvotes

14 comments sorted by

View all comments

Show parent comments

2

u/kristopolous Sep 06 '12 edited Sep 06 '12

last one isn't wrong. Depends on the platform. in IE it's totally true ... although probably not in the upcoming ie10. If the article was dated say March 3, 2008, it would be universally true.

1

u/kenman Sep 06 '12

No, you're wrong.

Check out any of the existing jsperf's, or create your own.

I just ran the this test on IE8 and IE9, here's the results: IE8, IE9

That is, in IE8 it's 2195 vs 348 ops/sec (almost 7x's slower), and in IE9 it's 19929 vs. 2834 ops/sec (around 8 times slower).

1

u/kristopolous Sep 06 '12

ok, I don't have the browsers at my disposal to do the other tests right now ... but here's the drama about this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=56940

1

u/kenman Sep 06 '12

It looks to me like that is a discussion of using + vs. +=, no?

I see one comment there referencing join(), but that author didn't justify his claims in any way and I don't think anyone else even responded to it.

On top of that, that bug was created in 2000; as far as web dev goes, that's eons ago and IMO 100% irrelevant when discussion performance issues of code in the year 2012.