클래스 정의

class Person { }
//클래스 선언문 

const Person = class {};
//익명 클래스 표현식

const Person = class MyClass {};
//기명 클래스 표현식
//클래스 선언문
class Person {
	constructor(name) {
	//생성자, 인스턴스 생성 및 초기화
	this.name = name;
	// name 프로퍼티는 public
}
	sayHi() { //프로토타입 메서드
		console.log(`Hi! My name is ${this.name}`);
}

static sayHello(){ //정적 메서드
	console.log('hello!');
	}
} 

//인스턴스 생성
const me = new Person('Lee');

//인스턴스의 프로퍼티 참조
console.log(me.name) // Lee

//프로토타입 메서드 호출
me.sayHi(); // Hi! My name is Lee

//정적 메서드 호출
Person.sayHello(); // hello!

인스턴스 생성

class Person {}
const me = new Person();
console.log(me) // Person {}