I'd really like to have a strict mode for fields as well: only declared fields exist. Right now typos can ruin everything, when you have this.itemList in the constructor and assign to this.itmeList elsewhere, then spend a half-day scratching you head wondering why some bits of the code don't work!
I'd really like to have a strict mode for fields as well: only declared fields exist. Right now typos can ruin everything, when you have
this.itemList
in the constructor and assign tothis.itmeList
elsewhere, then spend a half-day scratching you head wondering why some bits of the code don't work!Guess that's what you get with dynamic typing :D
Isn't "use strict" the solution for that kind of situation?
Sadly no.
TypeScript or Flow are the solution.