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 |
Tags
- Temporal dead zone
- javascript
- innerHTML
- keyup
- CSS
- for loop
- HTML
- Dom
- js
- nodeValue
- UI
- textContent
- innerText
- es6
- react
- css:position
- Review
- dotenv
- Event
- modal
- keyboardEvent
- Empty
- node
- TypingEffect
- yet
- a11y
- ES5
- node.js
- beforeinput
- addEventListener
Archives
- Today
- Total
the murmurous sea
JS OOP: 본문
class Person {
constructor (name, first, second) {
this.name = name;
this.first = first;
this.second = second;
}
}
const Kim = new Person(Kim, 10, 20);
console.log('Kim:', Kim);
위의 코드처럼 const나 let을 사용하면 temporal dead zone에 있게 되어 코드를 실행할 수 없음
class와 const/let 모두 ES6에서 새로 추가된 기능인데, 왜 같이 사용할 수 없지...? 어떻게 해야 같이 사용할 수 있지?
'#dev > undone Q' 카테고리의 다른 글
async vs. fetch (0) | 2020.06.25 |
---|---|
RegExp (0) | 2020.06.24 |
JS ES6: Promise vs. Async await (0) | 2020.06.15 |
JS ES5: strict / non-strict(sloppy) mode (0) | 2020.06.10 |
(Q)Is null a primitive data type in JS? (0) | 2020.06.03 |
Comments