<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>arr_push</title> </head> <body> <script> var n = []; n.push({name:"gsj"},{age:31}); console.log("n:", n); // n: [{name:"gsj"},{age:31}] // push() 方法可向数组的末尾添加一个或多个元素,并返回新的长度。 // arrayObject.push(newelement1,newelement2,....,newelementX) </script> </body> </html>
arr_push.html
猜你喜欢
转载自blog.csdn.net/weixin_42193179/article/details/87920655
今日推荐
周排行