Skip to content

Instantly share code, notes, and snippets.



Last active Dec 16, 2016
What would you like to do?
Closure Example
var loneTalker = {};
var addSpeach = function(name) {
var text = 'Hello ' + name;
var talk = function() {
}; = talk;
addSpeach('manu');; //expect 'Hello manu' as talk has still access to 'text' reference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment