Created
April 11, 2014 00:42
-
-
Save dovideh/10434647 to your computer and use it in GitHub Desktop.
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
var myClosure = function() { | |
var date = new Date(); | |
var nested = function() { | |
return date.getMilliseconds(); | |
}; | |
return { | |
foo: nested | |
}; | |
}; | |
var display = function () { | |
var output = document.getElementById("Output"); | |
var closure = new myClosure(); | |
output.innerHTML = closure.foo(); | |
window.setTimeout(function () { | |
output.innerHTML += "<br />" + closure.foo(); | |
}, 74); | |
}; | |
display(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment