Relative Content

Tag Archive for typescripttypes

Typescript JSON.parse() to class

I am experimenting with typescript in the typescript playground and found that it allows me to assign the object returned by JSON.parse() to a class, even though the object won’t have any methods, and this causes a runtime error. This is surprising to me as my understanding was that typescript is typesafe as long as you don’t use as or Any.