Originally posted by Garadon
read liorean code, and if you call that easy to read ur mad in IMHO , I strongly assume that script is optimised with minimising white spaces and new lines after u coded it .
"Make things as simple as possible, but no simpler"
I don't grock the syntax/style used by liorean either. But basic OO scripting w/ JS is not that esoteric. Nonetheless this supports my points. This detail code may look daunting, but USING it is quite another matter.
In fact I've been writing JS for over a year w/out using inheritance - because I didn't know how to do it. You simply won't find it discussed in virtually any published material. At times I wish I had it, but I managed. Just recently I've "seen the light". Search this forum for a recent thread; look for "closure" or "closures". That'll make your head swim...
Getting back to fundamentals... The basics of 'object based' scripting w/ JS gives you the basic encapsulation and nicely organized data / code. That's one giant leap. Get that down pat first.
Forcing(?) rigorous OO capabilities in JS is yet another giant leap. But as I understand it the basics of inheritance means utiizing the "prototype" property that every object (built-in and "home grown") has. You know that if you define a new method, for example "Array.prototype.MyFancyArrayFunction" that the "MyFancyArrayFunction" is "inherited" - is automatically available for use by every Array object. Follow the links from that thread I mentioned above, you find at least some of what you're looking for.