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 |
Tags
- 자율 주행
- react
- context api
- HD Map
- react props
- js call
- 하위 컴포넌트에 prop 전달
- React Child Component
- js call apply bind
- 고정밀지도
- 중첩된 prop
- 고정밀 지도
- js bind
- 컴포넌트 합성
- javascript
- Prop Drilling
- Javascript this undefined
- js apply
Archives
- Today
- Total
목록js call apply bind (1)
simkkong
[JavaScript] this와 call, apply, bind
this 는 현재 객체를 가리킨다. 정확히는 메서드를 호출할 때 사용된 객체를 의미한다. 즉 아래와 같이 animal 객체 안에서 run 메서드가 실행이 되면 run을 실행한 animal 객체를 가리키며, 전역에서 호출하게 되면, 글로벌한 window 객체를 가리킨다. let animal = { name: '코끼리', run() { console.log(this.name); } } animal.run() // '코끼리' (this == animal) //or class animal { constructor() { this.name = '코끼리'; } run() { console.log(this.name); } } const elephant = new animal() elephant.run() // '코끼..
Develop/JavaScript
2022. 11. 29. 18:26