[JavaScript] destructuring operator

2023. 3. 27. 21:40FE/JavaScript

 

1. destructuring operator

 

var obj={
   "a":2,
   "b":3
}
let {a,b}=obj;
console.log(a,b);

//출력 2 3

 

 

 

What does this javascript syntax means: const { headers, method, url } = request;

It's not clear what this syntax means const { headers, method, url } = request; found in this tut https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/

stackoverflow.com

 


'FE > JavaScript' 카테고리의 다른 글

[JavaScript] 자료형, 함수  (0) 2024.03.18
[JavaScript] BOM, DOM  (0) 2024.01.14
[Javascript] async & await  (0) 2023.03.01
[JavaScript] var과 let  (0) 2023.02.10
2022-08-22 JS_6  (0) 2022.08.22