?
This document uses PHP Chinese website manual Release
JScript? | 語言參考 |
創(chuàng)建一個新對象。
new constructor[(arguments)]
constructor
必選項。對象的構(gòu)造函數(shù)。如果構(gòu)造函數(shù)沒有參數(shù),則可以省略圓括號。
arguments
可選項。任意傳遞給新對象構(gòu)造函數(shù)的參數(shù)。
new 運(yùn)算符執(zhí)行下面的任務(wù):
下面這些是有效的 new 運(yùn)算符的用法例子。
my_object = new Object;
my_array = new Array();
my_date = new Date("Jan 5 1996");
版本 1
function 語句