0

Do the main Javascript interpreters have any built in optimisation at all? I'm thinking of very simple cases like

while(i < array.length) { ... } 
fearofawhackplanet
  • 52,166
  • 53
  • 160
  • 253

1 Answers1

0

your code can be optimize, if that's what you're asking.

var ln = array.length; // save length into local variable to reduce scope
while(ln--) { ... }  // only one value is evaluated in while statement
Headshota
  • 21,021
  • 11
  • 61
  • 82
  • He's asking for optimizations performed by the implementation, not by the programmer. –  May 12 '11 at 16:49