티스토리 뷰
JavaScript에서 this 키워드는 다른 언어에서의 this와 좀 다른 특징을 가지고 있다.
Java에서는 자기자신을 나타내는 용도로 사용되기에 parameter와 속성의 이름이 같을 경우나 다른 overloading된 constructor를 불러올때 사용되는데 반해 JavaScript에서는 호출하는 방법 즉, '호출한 객체' 가 누구(무엇)냐에 따라 this가 달라진다.
bind() method를 사용해 this를 고정시키는 방법도 있다.
Reference
'JavaScript' 카테고리의 다른 글
Callback function in JavaScript (0) | 2019.08.28 |
---|---|
Arrow function in JavaScript (0) | 2019.08.28 |
Closure in JavaScript (0) | 2019.08.27 |
Creating Object and document.write in JavaScript (0) | 2019.08.07 |
String and Number (0) | 2019.08.05 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 프로그래머스
- java
- code refactoring
- spring boot application
- math.max
- ... in Javascript
- 프로그래머스 알고리즘
- easy algorithm
- repeat()
- math.abs
- 프로그래머스 알고리즘문제
- Javascript Algorithm
- equals()
- hackerrank javascript solution
- Object type casting
- rest parameter
- javascript
- string class in java
- easy javascript algorithm
- hackerrank
- hackerrank solution
- hackerrank javascript
- HackerRank Algorithm
- algorithm
- 알고리즘
- compareTo()
- HashMap
- substring()
- Collection Framework
- C++
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함