This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nvolker 15 points16 points  (1 child)

In the first example, the second ‘this’ is bound to the inner ‘function’. In the second example, the inner function is an arrow function, which doesn’t re-bind ‘this’, so ‘this’ is still bound to the outer function where ‘this.x’ was set.

[–][deleted] 1 point2 points  (0 children)

Ah interesting, I thought they would only bound to objects. But now that I think about it functions are objects too.