⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classicalinheritance.js

📁 《AJAX基础》一书的源码
💻 JS
字号:
function Vehicle() {    var wheelCount = 4;    var curbWeightInPounds = 4000;    this.getWheelCount = function() {        return wheelCount;    }    this.setWheelCount = function(count) {        wheelCount = count;    }    this.getCurbWeightInPounds = function() {        return curbWeightInPounds;    }    this.setCurbWeightInPounds = function(weight) {        curbWeightInPounds = weight;    }    this.refuel = function() {        return "Refueling Vehicle with regular 87 octane gasoline";    }    this.mainTasks = function() {        return "Driving to work, school, and the grocery store";    }}function SportsCar() {    this.refuel = function() {        return "Refueling SportsCar with premium 94 octane gasoline";    }    this.mainTasks = function() {        return "Spirited driving, looking good, driving to the beach";    }}function CementTruck() {    this.refuel = function() {        return "Refueling CementTruck with diesel fuel";    }    this.mainTasks = function() {        return "Arrive at construction site, extend boom, deliver cement";    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -