인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

tongbg's profile image
tongbg

asked

JavaScript Intermediate to Advanced: Engine Core

6. this and prototype, referencing instances with this, this and prototype, calling prototype methods directly

prototype 메소드 직접 호출 - call , bind

Written on

·

154

0

this 강의 - call, bind 듣고 다시 보니 직접호출을

어떻게 하는지 알게 됐습니다.  직접 호출 방법 적어봅니다.

// call
console.log(Book.prototype.getPoint.call(obj));


// bind
console.log(Book.prototype.getPoint.bind(obj)());
javascript

Answer 1

0

tonextday님의 프로필 이미지
tonextday
Instructor

문법은 맞지만, bind()는 후속 코드를 작성해야 완전한 형태가 됩니다.

tongbg's profile image
tongbg

asked

Ask a question