Hello, your post helped me, but I want to suggest improvement:
class ArrayWrapper extends Array
method: -> console.log 'hello'
new ArrayWrapper().method() # This doesn't work!
It is can't be called "class" without methods, so:
class ArrayWrapper
proto = ArrayWrapper.prototype = Object.create Array.prototype
proto.method = -> console.log 'hello' # Yes, we are loosing simple methods notations
new ArrayWrapper().method() # great!
Hello, your post helped me, but I want to suggest improvement:
It is can't be called "class" without methods, so:
Markdown in this site infuriates me