Skip to content

Instantly share code, notes, and snippets.

@The-Quill
Last active February 23, 2016 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save The-Quill/4d50a202dd05415eb5e0 to your computer and use it in GitHub Desktop.
Save The-Quill/4d50a202dd05415eb5e0 to your computer and use it in GitHub Desktop.

i=1e300;for(;;i-->0){while(i&&alert('foo'));}

  • define i in the loop
  • use the var keyword to define variables (or let, when using for loop iterator variables)
  • i-->0 i is not how you make an ascii bow in javascript, D works better: D--> D -->0 (but seriously, write it properly. same effect)
  • while(i&&alert('foo') wouldn't this be slimmer if you put the alert in the loop? while(i)alert('foo')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment