Created
July 4, 2018 20:55
-
-
Save praveenkishor123/aadad7d05e9f9ad32e3b9c4cde4f5ef3 to your computer and use it in GitHub Desktop.
Prototype in Javascript
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 myObject = function(name){ | |
this.name = name; | |
return this; | |
}; | |
console.log(typeof myObject.prototype); // object | |
myObject.prototype.getName = function(){ | |
return this.name; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment