我不久前开始使用 JS,我想知道如何将 products 变量转换为 JavaScript 中的 detailProducts
const products = [
{ title: 'Yellow Pail',
submitterAvatarUrl: 'images/avatars/daniel.jpg',
productImageUrl: 'images/products/image-aqua.png',
},
{ title: 'Supermajority: The Fantasy Congress League',
submitterAvatarUrl: 'images/avatars/kristy.png',
productImageUrl: 'images/products/image-rose.png',
},
{ title: 'The art of cooking',
submitterAvatarUrl: 'images/avatars/james.png',
productImageUrl: 'images/products/image-gold.png',
}
]
const detailedProducts = [
{
detail: 'This book was submitted by Daniel',
title: 'Yellow Pail',
submitterAvatarUrl: 'images/avatars/Daniel.jpg'
}, {
detail: 'This book was submitted by Kristy',
title: 'Supermajority: The Fantasy Congress League',
submitterAvatarUrl: 'images/avatars/Kristy.png'
},
{
detail: 'This book was submitted by James ',
title: 'The art of cooking',
submitterAvatarUrl: 'images/avatars/James.png'
}
]
DIEA
相关分类