Skip to content

Instantly share code, notes, and snippets.

@pr00thmatic
Last active August 29, 2015 14:15
Show Gist options
  • Save pr00thmatic/6c568f5980ab6a83c7f0 to your computer and use it in GitHub Desktop.
Save pr00thmatic/6c568f5980ab6a83c7f0 to your computer and use it in GitHub Desktop.
execution context in module pattern
var dog = (function () {
var nombre = "dog";
var setName = function (newName) {
nombre = newName;
};
var speak = function () {
console.log('[' + nombre + ']: woof!');
};
// punto a
return {
setName : setName,
speak : speak
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment