3 ms·
It would have to determine that arr.length doesn't change during the loop. Pretty difficult problem. :)
by jeff18 17y ago
It would have to determine that arr.length doesn't change during the loop. Pretty difficult problem. :)
- gojomo 17y agoI'm unsure if the smiley means you're being sarcastic, but if not: Such determinations are a pretty common thing for an optimizing compiler to attempt: http://en.wikipedia.org/wiki/Loop-invariant_code_motion http://en.wikipedia.org/wiki/Loop-invariant_code_motion