typescript

Object

  • 프리미티브 타입이 아닌 것을 나타내고 싶을 때 사용한다.
  • number, string, boolean, symbol, null undefined 가 아닌걸 할달할 수 있을때 사용가능하다.
// create by object literal
const person1 = { name: "Kdong", age: 30 };

// person1 is not "object" type.
// person1 is "{ name: string, age: number }" type.

// create by Object.create(전역내장객체?)
const person2 = Object.create({ name: 'Kdong', age: 30});

 

 

Notion : https://torpid-pasta-de7.notion.site/Basic-Types-7c1eff4fb5f3449e932fb1d157da1f25

'TypeScript > Basic-Types' 카테고리의 다른 글

TypeScript - Tuple  (0) 2022.02.07
TypeScript - Array  (0) 2022.02.07
TypeScript - null & undefined  (0) 2022.02.07
TypeScript - symbol  (0) 2022.02.06
TypeScript - string  (0) 2022.02.06