现在有这样一个数组[{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}), {})
2.1m questions
2.1m answers
60 comments
57.0k users