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.
我有一个 JSON 数据,例如:
'1': { code: '1', type: 'car', }, '2': { code: '2', type: 'bike' }, ...
我不想在父级中解析 1 和 2。只有我需要拥有
[{code: '1', type: 'car', }, { code: '2', type: 'bike' }, ...]
我怎样才能做到这一点?
jsonArray = []; for (var i in JsonData) { jsonArray.push(jsonData[i]); }