does typescript know if a parameter is undefined (misspelled) or does it only find errors like 1+'1' ?
I made a small simple demo here: https://www.typescriptlang.org/play/index.html#src=const%20e...
Note: Click Options and enable all the settings. Typescript works best in strict mode, but it seems options arn't including in sharing via url.
In fact to set a global value (ex: window.Foo) requires a bit of extra work to instruct the type check that your new property is not errant.
Unless, of course, you're implying it converts javascript into a strongly typed language, which would be amazing.
1 + '1' is authorized.
1 + [] is not.