일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- vanilla js
- Clone
- scflix
- 오류
- expo
- Project
- Nomad coder
- 클론코딩
- react-hook
- 프로젝트
- 계획
- Nomad
- TiMER
- Nicolas
- 바닐라 자바스크립트
- github
- Hook
- CSS
- javascript
- Firebase
- HTML
- Vanilla
- react
- 코코아톡
- 자바스크립트
- coding
- 느낀 점
- Netflix
- 마무리
- react-native
- Today
- Total
목록Destructuring (2)
꾸매코딩
Spread . . . 으로 나타낸다. Array, Object들 안에 있는 요소(element)를 개별적으로 뽑아낼 수 있다. 뽑아낸 요소들로 새로운 Array, Object 만들기가 용이하다. Spread는 변수를 가져가서 풀어 헤친다(Unpack) [Array] const number = [1, 2, 3] //배열을 풀어 헤쳐서 개별 값들을 출력해줌 console.log(...number) //1 2 3 console.log(number) //[1, 2, 3] const english = ['a', 'b'] //새 배열로 만들어 사용하기 편함 const newArr = [...number, ...english] console.log(newArr) //[1, 2, 3, 'a', 'b'] [Object..
Destructuring 구조 분해 할당 구문은 배열이나 객체의 속성을 해체하여 그 값을 개별 변수에 담을 수 있게 하는 JavaScript 표현식입니다. [MDN] 객체나 배열에서 필요한 값을 개별 변수에 저장하는 것 객체 디스트럭처링 (Object destructuring) const settings = { notifications: { follow: true }, color: { theme: "yello" }, }; // 프로퍼티 key값을 기준으로 Destructuring되어 할당된다. const { notifications: { follow }, color} = settings; console.log(follow, color); // true { theme: 'yello' } 예시 //선언 co..