现在有这样一个数组[{key0: '1'}, {key1: '2'}]
[{key0: '1'}, {key1: '2'}]
我想转成这样的一个对象{key0: '1', key1: '2'}
{key0: '1', key1: '2'}
要怎么转一下
[{key0: '1'}, {key1: '2'}].reduce((acc, item) => ({...acc,...item}), {})
1.4m articles
1.4m replys
5 comments
57.0k users