我试图转换一个看起来像
的对象数组var someJsonObj = [
{id: 0, name: "name", property: "value", otherproperties: "othervalues"},
{id: 1, name: "name1", property: "value1", otherproperties: "othervalues1"},
{id: 2, name: "name2", property: "value2", otherproperties: "othervalues2"}
];
到
var someArray = [
[0,"name","value","othervalues"],
[1,"name1","value1","othervalues1"],
[2,"name2","value2","othervalues2"]
]
使用.push
,但我得到的是三个空数组或一个第一个值数组,如[0,1,2]
var someArray=[];
for(var i=0;i<someJsonObj.length;i++){
someArray.push(someJsonObj[i].val);
}
答案 0 :(得分:4)
在es6中使用public CadastrodeEscolasResponse TabelasAuxiliares(string requestex) {
XmlSerializer serializer = new XmlSerializer(typeof(CadastrodeEscolasRequest));
StringReader rdr = new StringReader(requestex);
CadastrodeEscolasRequest request = (CadastrodeEscolasRequest)serializer.Deserialize(rdr);
}
:
Object.values()