Skip to content

Instantly share code, notes, and snippets.

@Eazybright
Forked from johnhunter/gist:1362075
Created September 17, 2019 07:22
Show Gist options
  • Save Eazybright/bbd7aa0941f926f86953dc60657a09ed to your computer and use it in GitHub Desktop.
Save Eazybright/bbd7aa0941f926f86953dc60657a09ed to your computer and use it in GitHub Desktop.
Example JavaScript Pseudo-class
// 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