Skip to content

Instantly share code, notes, and snippets.

@simplelife7
Created May 20, 2012 08:25
Show Gist options
  • Save simplelife7/2757304 to your computer and use it in GitHub Desktop.
Save simplelife7/2757304 to your computer and use it in GitHub Desktop.
【JS】循环优化
// 缓存
for(var i=0, j = document.getElementsByTagName('a').length; i0; i--){
}
// 据说是最快的
while(i--){
// maybe fastest
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment