# Type System
The JavaScript language has types like string
, object
, symbol
, boolean
etc, but it does not have a static type system.
Often when the term “type system” is used, it is referring to a static type system like TypeScript provides.
A static type system does not need to run your code in order to understand what the Shape of code at a particular location of a Source File looks like.
TypeScript uses a static type system to offer editing tools:
ts
const shop = {
name: "Table Store",
address: "Maplewood",
};
shop.a;
Try
As well as to provide a rich set of error messages when the types inside the type system don’t match up:
ts
let shop = {
name: "Table Store",
address: "Maplewood",
};
shop = {
nme: "Chair Store",
Object literal may only specify known properties, but 'nme' does not exist in type '{ name: string; address: string; }'. Did you mean to write 'name'?2561Object literal may only specify known properties, but 'nme' does not exist in type '{ name: string; address: string; }'. Did you mean to write 'name'? address: "Maplewood",
};
Try