Link Details

Link 84759 thumbnail
User 232026 avatar

By justinbezanson
via geekdaily.net
Published: Jun 04 2008 / 21:19

When you think of the keyword this you probably assume it refers to the current instance of the class. This is true for most object oriented languages like C# and Java. So, knowing this you would probably assume the same would be true of JavaScript and it’s this keyword. This is, however, not the case. Like a lot of things about writing object oriented code in JavaScript, this behaves differently in some situations. this does not always refer to the class instance depending on how you use it.
  • 17
  • 0
  • 1148
  • 326

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.