audipower

Extend Prototype

Nov 7th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(SomeClass) {
  2.     SomeClass.prototype.species = "Human";
  3.     SomeClass.prototype.toSpeciesString = function() {
  4.         return `I am a ${this.species}. ${this.toString()}`
  5.     }
  6. }
Advertisement
Add Comment
Please, Sign In to add comment