Skip to content

Instantly share code, notes, and snippets.

@sag1v
Created November 25, 2019 14:27
Show Gist options
  • Save sag1v/b63d07fe720d0b2968bd5d29c66bb055 to your computer and use it in GitHub Desktop.
Save sag1v/b63d07fe720d0b2968bd5d29c66bb055 to your computer and use it in GitHub Desktop.
Markdium-JavaScript - The prototype chain in depth
function Player(userName, score){
this = {} // ⚠️ done by JavaScript
this.__proto__ = Player.prototype // ⚠️ done by JavaScript
this.userName = userName;
this.score = score;
return this // ⚠️ done by JavaScript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment