I think Javascript is definitely way too forgiving. I just had a situation where a property name was mistyped. The value was "undefined" which then can be compared against strings. So the code worked without warnings but the results were wrong. Took several days to track this down in a long promises chain. With a typed language this wouldn't even have compiled.
But with JS you don't need to wait for your code to compile so you can test it much quicker. If you write tests then this is almost never a problem.
With typed languages, I often lose my train of thought while waiting for the compiler. When warnings come up, I'm like a robot, I don't actually think, I just follow the line numbers.
Statically typed languages make me lazy. I feel like I spend all my time and mental energy catering to the compiler. I like dynamically typed languages because it forces me to consider everything and keeps me on my toes.
You can't type things properly without considering the business logic. Once you have that figured out the correct logic comes easily.
The compiler should be sparing you from wasting mental energy on menial things by telling you what to do, even when making large changes that would be disgustingly complicated in a dynamic language.
If you feel like you're "catering to the compiler", then you're going about things wrong; because you're worrying about logic before nailing down the proper data structures.
>But with JS you don't need to wait for your code to compile so you can test it much quicker.
This is no loner a valid criticism as any decent IDE (or a mature Code Editor) can run static analysis as you type and warn you abut issue, before you even compile.
Source: VsCode does static analysis on TypeScript.
You can simply erase the types with TS and it’s ready to go. I think tsc does this automatically, but I’m not really sure because I always wait for the compiler to finish out of habit. It doesn’t seem to be incremental at all yet, so compilation times noticeably grow longer as your project does, unfortunately.