Ian Collins wrote:
The inner parantheses are redundant, and
for (var i = 0, len = data.length; i < len; i++)
{
is safer and more efficient. And since order does not seem to matter,
the following is even more efficient:
for (var i = data.length; i--;)
{
Just out of curiosity, is there any performance benefit in using --i?
Generally, some say so. Specifically, there is none here as you want
evaluation of `i' as continue-condition _before_ its value is decreased.
Using `--i' here instead would force you to compare `--i > -1' and the
like to achieve the same, while you do not need to with `i--' as `0'
evaluates to `false' in (this) boolean expression(s) already.
Please provide attribution of quoted material; your Mozilla includes
that line automagically for a reason.
PointedEars