Link Details

Link 9415 thumbnail
User 111696 avatar

By bloid
via snook.ca
Published: Dec 21 2006 / 10:27

The this keyword is used to reference the current function/object context. The problem is, a function can easily be 'detached' from the object it was originally defined as a method of then the this keyword no longer references what you thought it should and errors occur.
  • 10
  • 0
  • 1204
  • 220

Comments

Add your comment
User 190346 avatar

ilazarte replied ago:

1 votes Vote down Vote up Reply

this. is a major headache. in javascript, half of debugging is finding out what this. is! arg. scoping issues are definitely some the things i would really change about js if i could.

User 187417 avatar

sproketboy replied ago:

-2 votes Vote down Vote up Reply

Reason #786 why JavaScript is lame. :(

User 77421 avatar

rd112681 replied ago:

2 votes Vote down Vote up Reply

A mention of javascript in the title would have been appreciated.

User 201721 avatar

estacado replied ago:

1 votes Vote down Vote up Reply

Even until today, I still don't fully understand how to use "this".

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (10)



Voters Against This Link (0)