JavaScript Style Guide - Type

Jang Seok Woo·2022년 8월 11일
0

실무

목록 보기
98/136

1. Types

1.1 primitives (원시타입)

When you access a primitive type you work directly on its value.

  • string
  • number
  • boolean
  • null
  • undefined
  • symbol
  • bigint
const foo = 1;
let bar = foo;

bar = 9;

console.log(foo, bar); // => 1, 9

Complex

When you access a complex type you work on a reference to its value.

  • object
  • array
  • function
const foo = [1, 2];
const bar = foo;

bar[0] = 9;

console.log(foo[0], bar[0]); // => 9, 9

출처 : https://github.com/airbnb/javascript

profile
https://github.com/jsw4215

0개의 댓글