-
-
Save Eazybright/bbd7aa0941f926f86953dc60657a09ed to your computer and use it in GitHub Desktop.
Example JavaScript Pseudo-class
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
// Example Pseudo-class | |
var Animal = (function() { | |
function Animal(name) { | |
this.name = name; | |
} | |
Animal.prototype.getName = function () { | |
return this.name; | |
}; | |
return Animal; | |
}()); | |
var dog = new Animal('Fido'); | |
console.log(dog.getName()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment