mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
10 lines
229 B
CoffeeScript
10 lines
229 B
CoffeeScript
sleep = (ms) ->
|
|
new Promise (resolve) ->
|
|
window.setTimeout resolve, ms
|
|
|
|
window.countdown = (seconds) ->
|
|
for i in [seconds..1]
|
|
alert("#{i} second(s) to go...")
|
|
await sleep(1000) # wait one second
|
|
alert("done!")
|