Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- 카카오맵 api
- Nullish Coalescing Operator
- Python #CodeUp
- 프로그래머스
- Python #Baekjoon
- css #html
- React Kakao map
- HTML
- BOJ
- optional chanining
- Python
- Default parameter
- Hooks
- es6
- 카카오맵
- Next
- Template literals
- es11
- firebase
- CSS
- Redux
- nextjs
- react
- React #Hooks
- spread operation
- JavaScript
- HTML #CSS
Archives
- Today
- Total
거북이개발자
[ES6] Destructuring Assignment 본문
1. Destructuring Assignment
(1)일반적 객체내 값 접근시
const student1={
name : 'Ryu',
age : 18,
};
{
const name=student1.name;
const age=student1.age;
};
이런식으로 각각의 요소를 객체.요소와 같은 식으로 접근해줬다.
(2) Destructuring Assignment-객체
const student1={
name : 'Ryu',
age : 18,
};
{
const{name, age}=student1;
console.log(name, age);
};
const{name, age}=student1;을 통해서 name, age로 바로 접근이 가능하다.

(3) Destructuring Assignment-배열
const star=['☆', '★'];
{
const [first, second]=star;
console.log(first, second);
}
배열도 이런식으로 간단하게 사용이 가능하다.

'Web > ES6' 카테고리의 다른 글
| [ES11] Optional chaining (0) | 2021.02.07 |
|---|---|
| [ES6] Template Literals (0) | 2021.02.07 |
| [ES6] Default parameters (0) | 2021.02.07 |
| [ES6] Spread Syntax (0) | 2021.02.07 |
| [ES6] Shorthand property names (0) | 2021.02.07 |
Comments