📌  相关文章
📜  如何在javascript代码示例中将元素附加到数组

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

代码示例3
//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!