4 ms·
Have you tried TypeScript?
by hasenj 10y ago
Have you tried TypeScript?
- deno 10y agoTypescript is nice but its type system is not the strongest selling point. For example this compiles without warnings: const foo: Promise<string|null> = Promise.resolve(null); const bar: Promise<string> = foo; bar.then((value) => value.toString()); // runtime null error
- coldtea 10y agoThat's because null is an acceptable value for a string object. Which is the same thing as in Java and plenty of other languages.
- mathw 10y agoA bit. It's an improvement, but if you're writing Kotlin on the backend then Kotlin/JS starts to look tempting on the basis that it's the same language everywhere. Although using the same language in different environments obviously feels a bit different.