Re:What does ‘that = this’ in JavaScript mean?
by karol on Saturday April 08, 2017 @05:10PM
(#14069058)
By using `self` you shadow a global variable which is a reference to the current context (window object) in which the code is executed.
[ Parent
| on HN ]
Re:What does ‘that = this’ in JavaScript mean?
by lexicality on Saturday April 08, 2017 @06:20PM
(#14069380)
Which should be accessed by window.self anyway so it doesn't really matter? There are so many poorly named global variables (top etc) that worrying about shadowing them seems meaningless.