Mi Lugarcito
JS - this (Arrow function expression and Normal function) 본문
인스턴스 메서드를 만들어서 this를 사용하는 경우 function 키워드를 써줘야 한다.
그래야 자신이 속한 객체, 여기서는 this가 userSchema 도큐먼트를 가르킨다.
즉, 화살표 함수랑 일반 함수에서 this의 바인딩 차이점이 있다
(Arrow functions explicitly prevent binding this, so this method will not have access to the document and the above example wil not work!)
yceffort.kr/2020/05/difference-between-function-and-arrow
poiemaweb.com/es6-arrow-function
developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Functions/Arrow_functions
'JavaScript' 카테고리의 다른 글
Checkbox - 수정한 체크박스 값 디비에 Y/N 수정값으로 저장하기 (0) | 2021.08.25 |
---|---|
Radio - 버튼 클릭시 해당 div만 show/non-show 해주기 (0) | 2021.08.25 |
DOM? Document Object Model (0) | 2021.04.10 |
JavaScript - Rest Parameter (0) | 2021.04.09 |
Json 파싱관련 유용한 사이트 모음 (0) | 2021.04.07 |