Created
August 3, 2016 03:55
-
-
Save anonymous/7ad3b4d6007e5e14c424aeef3e86198d to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/poxuce
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
"use strict"; | |
var message = "hi"; | |
{ | |
var _message = "bye"; | |
} | |
console.log(message); | |
var fs = []; | |
var _loop = function (i) { | |
// var/let i | |
fs.push(function () { | |
return console.log(i); | |
}); | |
}; | |
for (var i = 0; i < 10; i++) { | |
_loop(i); | |
} | |
fs.forEach(function (f) { | |
return f(); | |
}); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">let message = "hi"; | |
{ | |
let message = "bye"; | |
} | |
console.log(message); | |
let fs = []; | |
for(let i = 0; i < 10; i++) { // var/let i | |
fs.push(() => console.log(i)); | |
} | |
fs.forEach( f => f() ) | |
</script></body> | |
</html> |
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
"use strict"; | |
var message = "hi"; | |
{ | |
var _message = "bye"; | |
} | |
console.log(message); | |
var fs = []; | |
var _loop = function (i) { | |
// var/let i | |
fs.push(function () { | |
return console.log(i); | |
}); | |
}; | |
for (var i = 0; i < 10; i++) { | |
_loop(i); | |
} | |
fs.forEach(function (f) { | |
return f(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment