我想复制数组中的 3 个对象,直到总共有 50 个。我该怎么做呢?
var listings = [
{
address: "123 41st St",
bedrooms: 2,
bathrooms: 2,
image: "img/1bdrm_a.jpg"
},
{
address: "234 52nd St",
bedrooms: 1,
bathrooms: 1,
image: "img/1bdrm_b.jpg"
},
{
address: "345 63rd St",
bedrooms: 3,
bathrooms: 2,
image: "img/1bdrm_c.jpg"
}
];