Joose is an open source "object system" built with JavaScript on top of JS which allows one to employ classes, modules, roles (like mixins) and a number of other programming concepts found in Ruby, Smalltalk and other popular OO languages. It was inspired Perl's Moose system.
I'm quite frequently plugging Joose in my comments here on HN, but I don't want to give the impression I'm just reflexively "advertising" for it anytime someone mentions JavaScript. As JS continues to rise in popularity and importance for both client-side (mobile, browser, etc.) and server-side apps, adoption of "power tools" like Joose can help one to avoid "re-inventing the wheel" over and over again.
Something similar is Coglan's JS.Class, which is modeled very closely on Ruby:
Check it out!
http://joose.it/
current release of ver 3: http://openjsan.org/doc/s/sa/samuraijack/Joose/3.012/lib/Joo...
There's a nice side-by-side comparison of what it looks like to build some classes with and without Joose here:
http://openjsan.org/doc/s/sa/samuraijack/Joose/3.012/lib/Joo...
I'm quite frequently plugging Joose in my comments here on HN, but I don't want to give the impression I'm just reflexively "advertising" for it anytime someone mentions JavaScript. As JS continues to rise in popularity and importance for both client-side (mobile, browser, etc.) and server-side apps, adoption of "power tools" like Joose can help one to avoid "re-inventing the wheel" over and over again.
Something similar is Coglan's JS.Class, which is modeled very closely on Ruby:
http://jsclass.jcoglan.com/