我有對象的這樣與具有點屬性對象的排序陣列分離數
var arr = [{
"id": "1",
"Title": "Object1",
"SectionId": "1.2.1"
}, {
"id": "2",
"Title": "Object2",
"SectionId": "1.1.2"
}, {
"id": "3",
"Title": "Object3",
"SectionId": "1.0.1"
}, {
"id": "4",
"Title": "Object4",
"SectionId": "1"
}];
sectionId
具有分隔多個點陣列。如何根據sectionId
屬性按升序或降序排列數組?
([通過在JavaScript字符串屬性值排序對象數組]的可能的複製http://stackoverflow.com/questions/1129216/按照字符串排序的屬性值) – A1rPun
看看這個https://jsfiddle.net/62cuna7w/2/ – Ionut