ในตัวอย่างแรก คุณเพิ่งสืบทอด amitBaseClass ต้นแบบ
function SomeClass() {
}
SomeClass.prototype = Object.create(amitBaseClass.prototype); ในตัวอย่างที่สอง คุณกำลังเรียกใช้ฟังก์ชันตัวสร้าง ตัวอย่างของ amitBaseClass ถูกสร้างขึ้นและคุณกำลังสืบทอดผู้กรอก amitBaseClass วัตถุ
function SomeClass () {
}
SomeClass.prototype = new amitBaseClass (); ดังนั้น ทั้งคู่จึงทำงานแยกกัน