次の形式の JSON オブジェクトがあります。
{
items:{
nestedObj:{
position:3
},
nestedObj2:{
position:1
},
nestedObj3:{
position:2,
items:{
dblNestedObj:{
position:2
},
dblNestedObj2:{
position:3
},
dblNestedObj3:{
position:1
}
}
}
}
}
ネストされたオブジェクトの各レベルを位置属性でソートしようとしています。オブジェクトを再帰的に繰り返すことはできますが、並べ替えをどこから始めればよいかわかりません...