📜  如何追加到数组 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:31.850000             🧑  作者: Mango

代码示例2
//Use push() method
//Syntax: 
array_name.push(element);
//Example: 
let fruits = ["Mango", "Apple"];
//We want to append "Orange" to the array so we will use push() method
fruits.push("Orange"); 
//There we go, we have successfully appended "Orange" to fruits array!