Why make it complicated?
Why make it complicated?


Made with KolourPaint and screenshots from Kate (with the GitHub theme).
You're viewing a single thread.
Not to short-circuit the joke, but in this case, it's because the valid JavaScript version is...
let a
...and one of TypeScript's main design goals is to be a superset of JavaScript, that only adds syntax, and doesn't re-write it.
Beyond that, it's probably a case of some new language just using what the designer is familiar with.
12 0 ReplyTypeScript [...] only adds syntax, and doesn't re-write it.
I believe
enum
,const enum
, and decorators would like to have a word with you.4 0 ReplyWho says this is JS? Might be Rust.
3 0 ReplyThen the second part of my statement applies.
3 0 ReplyIn the case of Rust, you can also omit the type annotation in the vast majority of cases and the compiler will infer it.
3 0 Reply