IT/Programming Language10 [Javascript] Arrow Function vs Function Arrow function은 function과 동일한 개념이 아니다. Arrow function과 function의 차이점은 this Arrow Function은 this 바인딩을 갖지 않는다. 기존의 function은 this의 탐색 범위가 함수의 {} 안인 찾은 반면 Arrow Function에서 this는 일반적인 인자/변수와 동일하게 취급된다. function에서 this는 함수를 호출한 객체의 this를 가리킴 Arrow function에서 this는 상위 scope의 this를 가리킴 -> Lexical this function example // function(){}방식으로 호출할 때 function objFunction() { console.log('Inside `objFunction`:.. 2021. 10. 31. 이전 1 2 3 4 다음