// 앞서 생성자 함수에서 prototype으로 만들었던 내용을 class 로 바꿔본다.
// ES6 에서 새롭게 제공되었다. JS는 prototype 기반의 언어인데, 좀 더 신뢰감이 있는 다른
// 객체지향 프로그래밍 언어들의 영향을 받아서 class 라는 개념을 흉내내서 제공했다.
class User {
  constructor(first, last) {
    this.firstName = first;
    this.lastName = last;
  }
  getFullName() {
    return `${this.firstName} ${this.secondName}`;
  }
}

// malza, Amy, neo 를 instance 라고 한다.
const malza = new User('Malza', 'Park');
const Amy = new User('Amy', 'Park');
const neo = new User('Neo', 'Park');

console.log(malza);
console.log(Amy);
console.log(neo);