2 ms·
I did not know that. Another one is const to declare simple variables. There are some features, I agree. But how do I declare that a function returns a specific
by mejutoco 4y ago
I did not know that. Another one is const to declare simple variables. There are some features, I agree. But how do I declare that a function returns a specific type and have it enforced? IMO, only by switching to Typescript or similar.
- gizmo 4y agoVSCode can enforce return types with jsdoc annotations, even when using plain javascript. VSCode uses typescript internally for all type inference, so you get that for free. Type inference works flawlessly 95% of the time, even for iterators/generators/inheritance/containers.