positiveko / positiveko-blog

기술 블로그✨
2 stars 1 forks source link

js-this #5

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

자바스크립트의 this는 김춘수의 <꽃>이다

그동안 헷갈리지 않은 척했던 자바스크립트의 this를 제대로 정리합니다.

https://positiveko.netlify.app/js-this

heyman333 commented 2 years ago

블로그 즐겨찾기 하고 갑니다.

heyman333 commented 2 years ago

몇가지 오타가 있는거같아서 남깁니다

  1. if (i > 5) {
    plus.call(plus, i);
    }
    
    => 
    
    if (i < 5) {
    plus.call(plus, i);
    }
  2. Person.prototype.sayHi = function() => { console.log(`hi ${this.name}`); };
    => 
    Person.prototype.sayHi = function(){ console.log(`hi ${this.name}`); };
positiveko commented 2 years ago

@heyman333 안녕하세요! 알려주셔서 감사합니다 :) 1번은 예제도 적절치 못해 전체적으로 수정했습니다. 댓글 감사합니다!