Created
July 24, 2017 18:18
-
-
Save jtomchak/c251b2a720b8377e5d7fb58fdcd095c7 to your computer and use it in GitHub Desktop.
// source http://jsbin.com
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="timeoutLoop"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
const arr = [10, 12, 15, 21]; | |
for (var i = 0; i < arr.length; i++) { | |
setTimeout(function() { | |
console.log('The index of this number is: ' + i); | |
}, 3000); | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">const arr = [10, 12, 15, 21]; | |
for (var i = 0; i < arr.length; i++) { | |
setTimeout(function() { | |
console.log('The index of this number is: ' + i); | |
}, 3000); | |
}</script></body> | |
</html> |
This file contains hidden or 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
const arr = [10, 12, 15, 21]; | |
for (var i = 0; i < arr.length; i++) { | |
setTimeout(function() { | |
console.log('The index of this number is: ' + i); | |
}, 3000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment