Talk is cheap, show me the code
JS is cool, but it suck when dealing with classes and inheritance. Or that’s what I know. Doing it the old fashion way just breaking my heart all the time. Thank God I found this Base.js to mend my heart. Classes and inheritance in JS has never been this easy
and fun.
// Interfaces
var T = Base.extend( {
mSysT: null,
isValid: function() {
}
} );
// Video classes
var Video_T = T.extend( {
isValid: function() {
return this.mSysT.t() > 10;
}
} );
Uh oh, have I mention that I’ve used SpiderMonkey to summon JS in my console? I do have js in my console. Check this out
[geek@toni singapore-0.10.0]$ js -v
JavaScript-C 1.6 pre-release 1 2006-04-04 (OSSP js 1.6.20060803)
usage: js [-PswWxC] [-b branchlimit] [-c stackchunksize] [-v version] [-f scriptfile] [-e script] [-S maxstacksize] [scriptfile] [scriptarg...]
[geek@toni singapore-0.10.0]$ js
js> print(’foo’);
foo
js> quit
function quit() {
[native code]
}
js>
This section gives me most headache. But experience told me that this blog mostly contains personal ramblings related to daily life, open source, and web 2.0. Recently, it turns out to be an idea-box where you can found ideas you can execute in your new startup ;). My ideas and opinions are not bullet proof and never intended to be one way stream. Kindly participate to improve your and my perspective regarding any particular post. Welcome aboard and enjoy your stay
Leave a reply