Types vs data

Types are meta-information - they only exist for the sake of enforcing how actual information is processed. Consider the simple program below.

TypeScriptJavaScript
compiling...

In the JavaScript produced by the TypeScript compiler, there are no types - only the instructions that operate on data. Attempting to use a type as a value will produce an error.

Was this page helpful?