asked
JavaScript Intermediate to Advanced: Engine Core
6. this and prototype, referencing instances with this, this and prototype, calling prototype methods directly
Written on
·
154
0
this 강의 - call, bind 듣고 다시 보니 직접호출을
어떻게 하는지 알게 됐습니다. 직접 호출 방법 적어봅니다.
// call console.log(Book.prototype.getPoint.call(obj)); // bind console.log(Book.prototype.getPoint.bind(obj)());
Answer 1
문법은 맞지만, bind()는 후속 코드를 작성해야 완전한 형태가 됩니다.