Last active
August 29, 2015 14:15
-
-
Save pr00thmatic/6c568f5980ab6a83c7f0 to your computer and use it in GitHub Desktop.
execution context in module pattern
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
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