Neither JS nor TS is my 'main language', but one big advantage of using Typescript I noticed immediately is that editors can provide much more Intellisense information while typing and immediately show error squiggles if a function call parameter isn't what the API expects (same as in any other statically typed language of course, but for writing 'web code' I thought that's a pretty big deal). This probably also works with WebIDL for regular JS APIs (as I said, JS is not my main language), but in TS this just works automatically also for your own APIs.
Comments
Neither JS nor TS is my 'main language', but one big advantage of using Typescript I noticed immediately is that editors can provide much more Intellisense information while typing and immediately show error squiggles if a function call parameter isn't what the API expects (same as in any other statically typed language of course, but for writing 'web code' I thought that's a pretty big deal). This probably also works with WebIDL for regular JS APIs (as I said, JS is not my main language), but in TS this just works automatically also for your own APIs.