サイト内検索

Array プロパティ一覧

スポンサー

ホーム > Array > constructor

constructor

オブジェクトの作成元の参照を取得します.

シンタックス

object.constructor

サンプルコード

以下にconstructorプロパティを使用したサンプルコードを示します.

<html>
  <head>
    <title>constructorプロパティのサンプルコード</title>
  </head>
  <body>
    <script type="text/javascript" language="javascript">
      var ary = new Array();

      /* constructorプロパティの値を表示 */
      document.write(ary.constructor + "<br />");

      if (ary.constructor == Array) {
        document.write("Arrayオブジェクト");
      } else {
        document.write("Arrayオブジェクト以外");
      }
    </script>
  </body>
</html>

実行例

サンプルコードの実行結果は以下のようになります.

function Array() { [native code] }
Arrayオブジェクト

スポンサード リンク

inserted by FC2 system