Comment on JavaScript – Array Direct AssignmentComments−marijn13ySee also this benchmark, which seems to have very different results from the scottlogic link: http://jsperf.com/array-push-vs-array-length23333/2I just re-ran it on FF24 (nightly), and also saw results where .push beats this kludge.So before everyone runs off and takes 'direct array assignment is fast' as a rule of thumb, please consider that it quite probably isn't.−hayksaakian13yAlso faster in most versions of chrome
Comments
See also this benchmark, which seems to have very different results from the scottlogic link: http://jsperf.com/array-push-vs-array-length23333/2
I just re-ran it on FF24 (nightly), and also saw results where .push beats this kludge.
So before everyone runs off and takes 'direct array assignment is fast' as a rule of thumb, please consider that it quite probably isn't.
Also faster in most versions of chrome