Hi!

I'm quite new to javascript and MooTools.
I have a class that looks like following:

var FooComponent = new Class({
    elem: new Element('div'),
    status: this.getCurrentStatus()
});

Two questions:
1) When I access elem property as FooComponent.elem, will Element be
instantiated only once (when I access it for the first time) or is it
instantiated each time I access elem property?
2) When I access status property, which object does 'this' belongs to?

And one more general javascript question. What does a function wrapped
in parentheses mean in javascript? This can be often found in MooTools
source code:
(function(){
    // function body
})();

Thanks in advance.
Sorry for my English.

-- 
with regards,
Maxim

Reply via email to