JS 클래스

SOMEmo·2022년 4월 26일
1
  1. 생성자 함수(prototype) 어려움
const heropy = new User('Heropy', 'Park')

User.prototype.getFullName = function () {
  return `${this.firstName} ${this.lastName}
}
  1. this 어려움
    일반(Normal) 함수는 호출 위치에서 따라 this 정의.
    화살표(Arrow0 함수는 자신이 선언된 함수 범위에서 this 정의.

  2. ES6 Classes

2개의 댓글

comment-user-thumbnail
2022년 4월 26일

그만 똑똑해...!!

1개의 답글