Object oriented JS
Posted: Tue Feb 28, 2006 7:26 am
Been working with OOP on JS for a while now writing my own objects and stuff. I've today realised that there's obviously a lot I don't know though. I'm reading over some code that uses syntax like:
Never seen that before
When I recurisvely print it I see it's just an object which is how I would do:
So is the first one just some sort of static class so to speak since it never gets instantiated. Not sure what to google for on this because it's not in any of the tutorials I read about JS OOP.
Also... the code I'm reading contains this:
What's the $ do? I feel quite left behind here 
Code: Select all
var foo = {
x: 5,
y: 10
};Code: Select all
function foo()
{
this.x = 5;
this.y = 10;
}
var foo = new foo();Also... the code I'm reading contains this:
Code: Select all
this.something = $(something);