r/javascript • • May 28 '19

What are some JavaScript things beginners don't know?

333 Upvotes

383 comments sorted by

View all comments

Show parent comments

2

u/8lbIceBag May 29 '19

If you're using this in a closure I feel for most cases you're doing it wrong

1

u/thisisafullsentence May 29 '19

I generally agree in terms of code style, but many beginners wonder why `this` keeps changing and that's usually a result of a closure. The most typical solution of course is an arrow function but that syntax is an ES6 luxury.