On Dec 9, 1:30 am, Jake Verbaten <[email protected]> wrote:
> It would be great if people didn't answer with _completely_ wrong solutions.
>
> Before you recommend an answer please run it in a JavaScript console to
> check it works.
>
> As an aside to those who said `this.a` it may time you learned how `this`
> actually works.

Yes.

This isn't Stackoverflow, you can't edit posts once they are posted so
publishing wrong answers means that others need to post corrections in
addition to the correct answer.

For the record: objects don't have a special *this* property,
functions do (strictly, it is a property of the function's variable
object). A function's this variable is set *by the call* and depends
on the type of code being executed. It can be any object in ES 3 and
also null or undefined in ES5 strict mode.


--
Rob

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to