In Javascript OO, when should I use the this
keyword?
Also, if I want to call a method of a class from another method of the same class, should I use this
or just the name of the function? E.g is this correct?
function Foo()
{
this.bar= function()
{
alert('bar');
}
this.baz= function()
{
this.bar(); //should I use this.bar() or just bar()?
}
}