开发者

Run time optimisation in Javascript

开发者 https://www.devze.com 2023-03-05 04:40 出处:网络
Do the 开发者_如何转开发main Javascript interpreters have any built in optimisation at all? I\'m thinking of very simple cases like

Do the 开发者_如何转开发main Javascript interpreters have any built in optimisation at all? I'm thinking of very simple cases like

while(i < array.length) { ... } 


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号