webpack-merge() vs Object.assign()
const webpackMerge = require("webpack-merge")
const object1 = {
'x': [{'a': 'a' }, { 'b': 'b' }]
}
const object2 = {
'x': [{'c': 'c' }, { 'd': 'd' }]
}
console.log('result webpackMerge: ',
webpackMerge(object1, object2)
)
console.log('result Object.assign: ',
Object.assign({}, object1, object2)
)
console.log('result Object spread: ',
{...object1, ...object2}
)
no comments