by z3t4 · 9y ago · 0 comments
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.