Created
March 26, 2017 12:55
-
-
Save M3kH/0c5fd30225a188a82ae3234d75fec051 to your computer and use it in GitHub Desktop.
Controlling While loops
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ABlockingFunction( stopAtTime ){ | |
var StartAt = new Date(); | |
var animation = ['Running...']; | |
while( StartAt <= stopAtTime ){ | |
StartAt = new Date(); | |
animation.push('.') | |
console.log(animation.join('')); | |
} | |
return this; | |
} | |
var stopAt = new Date(); | |
stopAt.setMinutes(stopAt.getMinutes() + 1); | |
ABlockingFunction(stopAt); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment