30 ms·
I agree, and I consider TypeScript to be twice as fast to develop in as plain JavaScript just because you don't need to: * Look up member names * Look up obje
by SomeCallMeTim 10y ago
I agree, and I consider TypeScript to be twice as fast to develop in as plain JavaScript just because you don't need to:
* Look up member names
* Look up object hierarchy structures
* Run code (or tests) to verify that you've done the above correctly
When the compiler knows the types, it can bring your code up to 90% correct. Half the time you don't even need to specify types: TypeScript can guess them from context.
You need to specify parameter types and return types; if you're declaring a variable without initializing it, or assigning it an empty array or object, you need to specify its type. Other than that you generally get type inference from TypeScript (at least as of 2.0).