Skip to content

Instantly share code, notes, and snippets.

@metafeather
Created November 3, 2009 13:23
Show Gist options
  • Save metafeather/225044 to your computer and use it in GitHub Desktop.
Save metafeather/225044 to your computer and use it in GitHub Desktop.
/*
Created using http://jsbin.com
Source can be edit via http://jsbin.com/ukipo/edit
*/
var alldivs = document.getElementsByTagName('div');
for (var i = 0; i < alldivs.length; i++) { // infinite loop
document.body.appendChild(document.createElement('div'));
}
// because .length is a live value and is updating when you call it - therefore becomes an infinite loop!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment