JavaScript: Extending Singletons experiment with ES6
Radu B. Gaspar
32
Hello,
It is an instance of PlayerModel and Keyboard and EventDispatcher, event if it is not a singleton. `instanceof` it is just a prototype chain look up, to see if any `constructor` (__proto__.constructor) matches the one you are testing.
JS Bin
A live pastebin for HTML, CSS & JavaScript and a range of processors, including SCSS, CoffeeScript, Jade and more...jsbin.com
A live pastebin for HTML, CSS & JavaScript and a range of processors, including SCSS, CoffeeScript, Jade and more...jsbin.com
And then again, I might be wrong :)
`The instanceof operator tests whether an object has in its prototype chain the prototype property of a constructor.` https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/instanceof