我正在尝试以下代码:
function doSomething(field, value) {
var someObj = { field : value };
console.log("The object looks like : %j, someObj);
}
我称之为 doSomething('emailid', 'a@b.com');
The output was {field : 'a@b.com'}.
如何使字段从函数调用中获取值?
Would like to get these values : {'emailid', 'a@b.com'}
谢谢你的时间。