我有一个伪造的数据对象user
,如下所示:
const user = {
_id: String,
name: String,
userUploads: Array,
};
如何在user
中复制userOne
以获得类似的内容
const userOne = {
_id: 'dddddd',
name: 'Chioma',
userUploads: [
{
id: 0,
// eslint-disable-next-line max-len
image: 'http://sugarweddings.com/files/styles/width-640/public/1.%20The%20Full%20Ankara%20Ball%20Wedding%20Gown%20@therealrhonkefella.PNG',
reactions: {
dislike: 0,
like: 0,
maybe: 0,
},
story: "It's my birthday next week! What do you think?",
},
{
id: 1,
// eslint-disable-next-line max-len
image: 'https://dailymedia.com.ng/wp-content/uploads/2018/10/7915550_img20181007141132_jpeg01c125e1588ffeee95a6f121c35cd378-1.jpg',
reactions: {
dislike: 0,
like: 0,
maybe: 0,
},
story: 'What do you think about this?',
},
{
id: 2,
// eslint-disable-next-line max-len
image: 'https://i0.wp.com/www.od9jastyles.com/wp-content/uploads/2018/01/ankara-styles-ankara-styles-gown-ankara-tops-ankara-gowns-ankara-styles-pictures-latest-ankara-style-2018-latest-ankara-styles-ankara-ankara-styles.png?fit=437%2C544&ssl=1',
reactions: {
dislike: 0,
like: 0,
maybe: 0,
},
story: 'Saturdays are for weddings. Yay or nay?',
},
],
};