UK [k?n?str?kt?(r)] US [k?n'str?kt?]

n.Constructor

複數(shù)形:constructors

javascript constructor屬性 構(gòu)文

コンストラクター屬性は何を意味しますか?

コンストラクターは各関數(shù)のプロトタイプ屬性に存在し、このオブジェクトを作成した配列関數(shù)への參照を返します。

関數(shù): このオブジェクトを作成した配列関數(shù)への參照を返します。

構(gòu)文: object.constructor

説明: コンストラクター プロパティは、このオブジェクトを作成した配列関數(shù)への參照を返します。

コメント: なし

javascript constructor屬性 例

<html>
<body>

<script type="text/javascript">

var test=new Array();

if (test.constructor==Array)
{
document.write("This is an Array");
}
if (test.constructor==Boolean)
{
document.write("This is a Boolean");
}
if (test.constructor==Date)
{
document.write("This is a Date");
}
if (test.constructor==String)
{
document.write("This is a String");
}

</script>

</body>
</html>

インスタンスの実行 ?

[インスタンスの実行] ボタンをクリックしてオンライン インスタンスを表示します