?
This document uses PHP Chinese website manual Release
JScript? | 語言參考 |
表示創(chuàng)建對象的函數。
object.constructor
必需的 object是對象或函數的名稱。
constructor 屬性是所有具有 prototype 的對象的成員。它們包括除 Global 和 Math 對象以外的所有 JScript 固有對象。constructor 屬性保存了對構造特定對象實例的函數的引用。 例如:
x = new String("Hi"); if (x.constructor == String)
???//
進行處理(條件為真)。
或
function MyFunc {
???//
函數體。 }y = new MyFunc;
if (y.constructor == MyFunc)
???
//
進行處理(條件為真)。
版本2
prototype 屬性
應用于: Array 對象 | Boolean 對象 | Date 對象 | Function 對象 | Math 對象 | Number 對象 | Object 對象 | String 對象