Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
var x = [{id: string}];
我在尝试x.push({id: 'abc'});
x.push({id: 'abc'});
它不起作用。语法正确吗?
在以下行中string 创建错误,因为我不知道您为什么要使用它?
string
尝试这个
var x = []; x.push({id: 'abc'});