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

📄 8-2.txt

📁 Javascript语言开发经典教程开发
💻 TXT
字号:
// This function uses the this keyword, so it doesn't make sense to// invoke it by itself; it needs instead to be made a method of some// object that has "width" and "height" properties defined.function compute_area(){    return this.width * this.height;}// Create a new Rectangle object, using the constructor defined earlier.var page = new Rectangle(8.5, 11);// Define a method by assigning the function to a property of the object.page.area = compute_area;// Invoke the new method like this:var a = page.area();    // a = 8.5*11 = 93.5

⌨️ 快捷键说明

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