我想做以下事情:
// an object
var object = {
one: null,
two: null,
three: null
};
// an array
var array = ['this is one', 'this is two', 'this is three'];
我现在想将它们合并在一起,所以我得到了;
var merged = {
one: 'this is one',
two: 'this is two',
three: 'this is three'
};
我不想只使用纯 javascript (ECMA5) 的任何第三个库。
那么诀窍是什么?
问候,博多