javascript this -명백한 바인딩(call, apply, bind) 호출
마지막으로 명백한 바인딩(call, apply, bind) 호출이다. call, apply, bind의 메서드는 명시적으로 this를 지정하고 싶을 때 사용한다. 첫 번째 인자가 항상 this값이 된다. call, apply와 bind는 this 값을 지정한다는 점에서는 같지만 call, apply의 경우는 this의 값을 지정하여 호출하지만 bind는 호출은 하지 않고 this값을 지정하여 함수만 반환한다. call, apply function printProfile(name, age) { return `${this.type} ${name} 나이:${age}` } const developer = { type: '개발자', feature: '언어' } const artist = { type: '아티스트'..
2021. 1. 16.