把完整代码发出来,你发图片看着累
语法:arr.push(newelement1,newelement2,....,newelementX)
示例代码:
var arr = [1,2];
arr.push(6); // arr:[1,2,6];返回值为3
arr.push('aa'); // arr:[1,2,6,"aa"];返回值为4
arr.push(undefined); // arr: [1,2,6,"aa",undefined];返回值为5
arr.push({a: "A", b: "B"}); // [1,2,6,"aa",undefined,{a: "A", b: "B"}];返回值为6