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: <a href="http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts" rel="nofollow">http://wiki.ecmascript.org/doku.php?id=harmony:specification...</a> and see some examples here: <a href="http://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes" rel="nofollow">http://wiki.ecmascript.org/doku.php?id=strawman:maximally_mi...</a><p>There's a cool project, Harmonizr (<a href="https://github.com/jdiamond/harmonizr" rel="nofollow">https://github.com/jdiamond/harmonizr</a>) which transpiles ES6 to ES5, which you can leverage to start using classes, modules, arrow syntax, etc. now. Demo: <a href="http://jdiamond.github.com/harmonizr/demo/demo.html" rel="nofollow">http://jdiamond.github.com/harmonizr/demo/demo.html</a>
Thanks for that. In my mind I've been calling C++, C#, etc. "class-based" programming since the design/programming phase is really focussed on classes. I've not much experience with prototype-based programming other than the occasional blurb. This is a nice intro.
I was just looking for something like this last week, this is a great tutorial, thanks for posting it up here.<p>When Anders was discussing the new TypeScript release, he was mentioning how it more clearly mimicked the ES6 specification. Looking at some of the examples posted by joubert, you can see the similarities.<p>TypeScript transpiles down to ES5 much like Harmonizr does as well.<p>Very interesting stuff.
I thought I had read it all at this point. I really like the deep dive into Object. No one ever goes beyond Object.create() and that's usually just as an example of how not to create new objects :)
or, for a shorter read, try <a href="http://yehudakatz.com/2011/08/12/understanding-prototypes-in-javascript/" rel="nofollow">http://yehudakatz.com/2011/08/12/understanding-prototypes-in...</a>