Guest User

Untitled

a guest
Dec 9th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. /*
  2. *
  3. * My problem is not being able to identify 't' as a Troll()
  4. *
  5. */
  6.  
  7. function Troll() {}
  8. Troll.prototype = new jaws.Sprite({})
  9. var t = new Troll()
  10.  
  11. t.constructor.name // "Sprite" ... how to I identify t as a Troll?
  12.  
  13. // Sure, I can do 'this.type = Troll' or simular inside Troll(), but a native way would be best.
Add Comment
Please, Sign In to add comment