Ticker

6/recent/ticker-posts

Ad Code

Responsive Advertisement

js 把一个数组,赋值给另一个数组对象指定属性的值

a = [
{ id: 1,  mouth: 10,},
{ id: 2,  mouth: 10,},
{ id: 3,  mouth: 10, },
]

b = [3,2,3];


想要结果:a = [
{ id: 1,  mouth: 3,},
{ id: 2,  mouth: 2,},
{ id: 3,  mouth: 3, },
]

该怎么赋值?

Enregistrer un commentaire

0 Commentaires