Node.js(구조분해 할당)

이정규 (가지마)·2023년 6월 3일
0

ex)

const example = {a:123 , b: { c: 135 , d:146}}
const a = example.a;
const d = example.b.d;

const {a,b:{d}} = example; //구조 분해 
console.log(a); // 123
console.log(d); // 146



arr = [1,2,3,4,5]
const x = arr[0]
const y = arr[1]
const z = arr[4]


const[x,y,,,z] = arr;




profile
"꾸준함이 답이다."

0개의 댓글