Created
May 4, 2016 15:19
-
-
Save TSMMark/0183f70167751af546bc16000f35f66f to your computer and use it in GitHub Desktop.
Chloe's javascript closure
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
function SecretHuman (name) { | |
this.getName = function () { | |
return name | |
} | |
} | |
var person = new SecretHuman("Chloe") | |
console.log("My name is " + person.getName()) // => My name is Chloe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment