Skip to content

Instantly share code, notes, and snippets.

@balinterdi
Created October 5, 2011 18:56
Show Gist options
  • Save balinterdi/1265313 to your computer and use it in GitHub Desktop.
Save balinterdi/1265313 to your computer and use it in GitHub Desktop.
wrong = ->
countdown = 10
h = setInterval ->
countdown--
, 100
do (->) until countdown is 0
clearInterval h
console.log 'Surprise!'
right = ->
countdown = 10
h = setInterval ->
countdown--
if countdown is 0
console.log 'Surprise'
clearInterval h
, 100
right()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment