將新元素添加到一個數(shù)組中,并返回數(shù)組的新長度值。
arrayObj.push([item1 [item2 [. . . [itemN ]]]])
push 方法將以新元素出現(xiàn)的順序添加這些元素。如果參數(shù)之一為數(shù)組,那么該數(shù)組將作為單個元素添加到數(shù)組中。如果要合并兩個或多個數(shù)組中的元素,請使用 concat 方法。
版本 5.5
concat 方法 | pop 方法
應(yīng)用于:Array 對象
© 2001 Microsoft Corporation. 保留所有權(quán)利。