r/ProgrammerTIL • u/Musical-Universe • Aug 13 '20
Other TIL to double check my variable declarations.
Spent three hours searching through my Javascript program to figure out why I was getting NaN in my arrays. After countless console.log() statements, I finally discovered i forgot a "this." for ONE variable in my constructor. sigh.
51
Upvotes
View all comments
Show parent comment
7
u/oluwie Aug 14 '20
Every developer has had countless stories like this in every language developed. Yea JavaScript allows you to do stuff like this and you can blame the language if you want, but it’s also just human error. Learn from it and hopefully it won’t happen again in the future.