[英]how to append the object into empty array
这是我的代码。 我在控制台中编写了代码
预期的output如下:
var myArray = [{
fruit: 'apple',
price: '90',
qty: '6'
},
{
fruit: 'mango',
price: '100',
qty: '6'
},
{
fruit: 'pineapple',
price: '50',
qty: '1'
}
];
这样的例子:
myArray .push({ fruit: 'apple', price: '90', qty: '6' })
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.