Ad
  • Default User Avatar

    I think it is worth noting that for ... of would be an improvement in this context since we don't actually care what the index is for each element.

  • Custom User Avatar

    for .. in is perfectly well-defined for arrays, and it's a simpler for than the C-style one, at least in syntax ( which actually is important in the grand scheme of readability / maintainability ).

    Speed isn't everything. Also, don't try to out-optimise your compiler.