javascript const animal = { eats: true, speak() { console.log("동물 소리"); } }; const dog = { barks: true }; // dog의 프로토타입을 animal으로 설정 Object.setPrototypeOf(dog, animal); dog.speak(); // "동물 소리" 출력 java…
"오버라이딩"에 대한 검색 결과 (총 21개)
javascript const animal = { eats: true, speak() { console.log("동물 소리"); } }; const dog = { barks: true }; // dog의 프로토타입을 animal으로 설정 Object.setPrototypeOf(dog, animal); dog.speak(); // "동물 소리" 출력 java…