Skip to content

Instantly share code, notes, and snippets.

@malikkurosaki
Created July 18, 2018 02:41
Show Gist options
  • Save malikkurosaki/9b972d4802de206dd314c3a67ac028f3 to your computer and use it in GitHub Desktop.
Save malikkurosaki/9b972d4802de206dd314c3a67ac028f3 to your computer and use it in GitHub Desktop.
javascript create circle increment loop
burung()
function burung(){
var terbang = true;
var kepak = 0;
mulai();
function mulai(){
if(terbang == true){
kepak +=1;
if(kepak >= 10){
terbang = false;
}
}else{
if(terbang == false){
kepak -= 1;
if(kepak <=0){
terbang = true
}
}
}
setTimeout(mulai,100);
console.log(kepak)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment