403
SD010
8y

'this' in JavaScript

Enough said :|

Comments
  • 6
    So true 😂
    ES2015 spec make this clearer, though. You need to check that out 👍
  • 4
    "this" is the problem
  • 0
    Gaah, "this" is shit.
  • 1
    scope
  • 1
    ES6 arrow functions ftw
  • 2
    var _this = this;
  • 4
    1.In a method, this refers to the owner object.
    2. Alone, this refers to the global object.
    3. In a function, this refers to the global object.
    4. In a function, in strict mode, this is undefined.
    5. In an event, this refers to the element that received the event.
    6. Methods like call(), and apply() can refer this to any object.

    Hope this answers your rant
  • 0
    okay but what the heck is #microFrontend
  • 0
    Does it is really hard to know to what "this" is currently reffering?

    If so i guess i am really good in JS :D
  • 0
    Agree.... JavaScript is soooo convoluted...
  • 0
    Undefined
  • 0
    "This" is so true, is it?
Add Comment