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

📄 object.js

📁 这是《JavaScript学习源代码》一书的源代码
💻 JS
字号:
// create a new car object
var car = new Object();

// add some properties to the car object...
car.maker = "Dodge";
car.model = "Viper";
car.color = "Silver";

// display all the car object's property values...
alert( car.color + " " + car.maker + " " + car.model );


// add a method to the car object...
car.startup = startup;

// define the startup method...
function startup()
{
  alert("... the motor is now running!");
}


// call the car object's startup method...
car.startup();

//-----------------------------------
// You can also create a new instance of the car object like this...

// var van = new Object(car);
// van.model = "RAM day van";
// van.color = "Blue and White";

// alert(van.color + " " + van.maker + " " + van.model );

⌨️ 快捷键说明

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