久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      JavaScript怎么創(chuàng)建空數(shù)組

      JavaScript創(chuàng)建空數(shù)組的方法:1、利用數(shù)組直接量“[]”,語法“var 數(shù)組名=[];”;2、利用Array()函數(shù),語法“var 數(shù)組名=new Array();”或“var 數(shù)組名=new Array(數(shù)組長度值);”。

      JavaScript怎么創(chuàng)建空數(shù)組

      本教程操作環(huán)境:windows7系統(tǒng)、javascript1.8.5版、Dell G3電腦。

      方法1:利用數(shù)組直接量“[]

      數(shù)組直接量的語法格式:在中括號中包含多個值列表,值之間用逗號分隔。

      var 數(shù)組名=[值列表];

      如果值列表為空,則可創(chuàng)建一個空數(shù)組。

      var arr = [];  //空數(shù)組 console.log(arr);

      JavaScript怎么創(chuàng)建空數(shù)組

      方法2:利用Array()函數(shù)

      使用 new 運算符調(diào)用 Array() 類型函數(shù)時,可以構(gòu)造一個新數(shù)組。

      var 數(shù)組名 = new Array(值列表);

      同樣如果值列表為空,則可創(chuàng)建一個空數(shù)組。

      var arr = new Array();   console.log(arr);

      JavaScript怎么創(chuàng)建空數(shù)組

      如果給Array()傳遞一個數(shù)值參數(shù),則該參數(shù)值等于數(shù)組 length 的屬性值,可以定義數(shù)組的長度,即包含元素的個數(shù)。

      var arr = new Array(5);  //有指定長度的空數(shù)組 console.log(arr);

      JavaScript怎么創(chuàng)建空數(shù)組

      【推薦學(xué)習(xí):javascript高級教程】

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號