DEV Community

Discussion on: 🧐Most Confusing Part Of JavaScript.

Collapse
 
larsejaas profile image
Lars Ejaas

My problem with the 'this' keyword is that you basically go against what is normally considered best coding practices.
'This' can refer to different elements or objects in the code, where with functions, objects etc. you always strive to use descriptive unique naming. I know 'this' is an integrated part of modern Javascript, but I can't shake the feeling that it introduces some level of confusion and decrease readability of the code. This is not bad practice, but to me it will never really feel like the cleanest solution either.