OLD/Javascript
[Javascript] Prototype에 대한 이해
1. 클래스와 생성자 함수의 차이 // 클래스 class DogCls { constructor(name, breed) { this.name = name; this.breed = breed; } bark() { return `${this.name} says woof`; } sleep() { return `${this.name} is sleeping`; } } const dog01 = new DogCls("asdf", "qwer"); const dog02 = new DogCls("ASDF", "QWER") // 생성자 함수 function DogFn(name, breed) { this.name = name; this.breed = breed; this.bark = function () { return `${..