Live data from Hacker News

Understanding Javascript OOP

killdream.github.com

21–23 of 23 posts

Re: Understanding Javascript OOP

#21
post #2

The ES6 draft spec now includes the (maximally minimal) class spec that was hashed out at the July TC 39 meeting. You can read the spec here: http://wiki.ecmascript.org/doku.php?id=harmony:specification... and see some examples here: http://wiki.ecmascript.org/doku.php?id=strawman:maximally_mi... There's a cool project, Harmonizr ( https://github.com/jdiamond/harmonizr ) which transpiles ES6 to ES5, which you can lev…

From my read of the proposal ES6 classes feel more like syntactic sugar for the flawed concept of new/constructor/obj.prototype, you still have to mess with obj.prototype to achieve some tasks (e.g. define non-enumerable property). I would stay away from it and just use plain objects with Object.create().
Post reply on HN