ํƒ€์ž… ๋ณ„์นญ

๐Ÿ“„ ํƒ€์ž… ๋ณ„์นญ

: ํŠน์ • ํƒ€์ž…์ด๋‚˜ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ฐธ์กฐํ•  ์ˆ˜ ์žˆ๋Š” ํƒ€์ž… ๋ณ€์ˆ˜

ํƒ€์ž… ๋ณ„์นญ์€ ์žฌ์‚ฌ์šฉํ•˜๋Š” ํƒ€์ž…์— ๋” ์‰ฌ์šด ์ด๋ฆ„์„ ํ• ๋‹นํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.
type์ด๋ผ๋Š” ํ‚ค์›Œ๋“ค๋ฅผ ์‚ฌ์šฉํ•ด ์„ ์–ธํ•ฉ๋‹ˆ๋‹ค.

type Person = {
  name: string;
  age: number;
};

var seho: Person = {
  name: "sujin",
  age: 28,
};

๐Ÿ“Œ ํƒ€์ž… ๋ณ„์นญ๊ณผ ์ธํ„ฐํŽ˜์ด์Šค์˜ ์ฐจ์ด์ 

์ธํ„ฐํŽ˜์ด์Šค๋Š” ํ™•์žฅ์ด ๊ฐ€๋Šฅํ•˜์ง€๋งŒ ํƒ€์ž… ๋ณ„์นญ์€ ํ™•์žฅ์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

๊ณ„์† ํƒ€์ž…์„ ํ™•์žฅํ•  ํ•„์š”๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ์—๋Š” ํƒ€์ž… ๋ณ„์นญ๋ณด๋‹ค๋Š” ์ธํ„ฐํŽ˜์ด์Šค๋กœ ์„ ์–ธํ•ด์„œ ํ•„์š”ํ•  ๋•Œ ๋งˆ๋‹ค ํ™•์žฅํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

์ถœ์ฒ˜

Leave a comment