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
- Nullish Coalescing Operator
- Hooks
- React #Hooks
- HTML
- css #html
- firebase
- BOJ
- optional chanining
- Redux
- Next
- HTML #CSS
- React Kakao map
- Template literals
- Default parameter
- spread operation
- JavaScript
- CSS
- Python #Baekjoon
- Python
- 프로그래머스
- Python #CodeUp
- 카카오맵
- es11
- react
- 카카오맵 api
- nextjs
- es6
Archives
- Today
- Total
목록optional chanining (1)
거북이개발자

1. Optional chaining const person1={ name:'Ryu' job : { title 'Engineer', manager:{ name : bob, }, }, }; const person2={ name:'Kim', }; { function printManager(person){ console.log(person.job.manager.name); } } person1 과 person2의 객체가 있고, 매니저의 이름을 프런트하는 함수를 구현하고 싶다. (1)문제점 printManager(person1); printManager(person2); 위의 사진처럼 person2객체는 job, manger이 정의 되어있지 않아서 오류가 난다. (2)해결(&&연산자) { function pri..
Web/ES6
2021. 2. 7. 15:18