Skip to content

Instantly share code, notes, and snippets.

@dirkteucher
Created January 26, 2015 20:57
Show Gist options
  • Save dirkteucher/6dfd664baf97874ccbee to your computer and use it in GitHub Desktop.
Save dirkteucher/6dfd664baf97874ccbee to your computer and use it in GitHub Desktop.
Loop // source http://jsbin.com/kisujo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Loop</title>
</head>
<body>
<script id="jsbin-javascript">
var i = 0, howManyTimes = 12;
function f() {
console.log("This is a loop that will run howManytimes");
i++;
if( i < howManyTimes ){
setTimeout( f, 300 );
}
}
f();
</script>
<script id="jsbin-source-javascript" type="text/javascript">
var i = 0, howManyTimes = 12;
function f() {
console.log("This is a loop that will run howManytimes");
i++;
if( i < howManyTimes ){
setTimeout( f, 300 );
}
}
f();</script></body>
</html>
var i = 0, howManyTimes = 12;
function f() {
console.log("This is a loop that will run howManytimes");
i++;
if( i < howManyTimes ){
setTimeout( f, 300 );
}
}
f();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment