r/ProgrammerTIL • • 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

22 comments sorted by

View all comments

Show parent comment

13

u/2012DOOM Aug 14 '20

I mean, the reason we make languages more complicated (e.g. add typing), is to stop human error.

So it's definitely a criticism of the language that doesn't have built in safeguards.

But hey in a way that's the appeal of it.