일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- BOJ
- Redux
- HTML #CSS
- firebase
- Hooks
- CSS
- spread operation
- 카카오맵 api
- react
- Nullish Coalescing Operator
- es6
- Python
- optional chanining
- Next
- HTML
- Template literals
- JavaScript
- es11
- css #html
- 프로그래머스
- Default parameter
- React Kakao map
- React #Hooks
- Python #CodeUp
- 카카오맵
- nextjs
- Python #Baekjoon
- Today
- Total
목록es11 (2)
거북이개발자
1. || 연산자 문제점 { const name=''; const useName=name || 'Guest'; const num=0; const message=num || 'undefined'; console.log(useName); console.log(message); } 위의 코드를 보면 ||연산자는 '', 0을 모두 false로 인식한다. 이러한 인식은 사용자에게 혼란과, 버그를 야기할 수 있다. 2. Nullish Coalescing Operator { const name=''; const useName=name ?? 'Guest'; const num=0; const message=num ?? 'undefined'; console.log(useName); console.log(message); ..
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..