0
反轉json數據順序的最佳方法是什麼?反向對象元素順序
var myObject = [
{"id":"001", "content":"content11111111111111"},
{"id":"002", "content":"content22222222222222"},
{"id":"003", "content":"content33333333333333"},
{"id":"004", "content":"content44444444444444"}
];
myJson = JSON.stringify(myObject);
var inverseMyJson = inverseOrder(myJson);
inverseMyJson ==>
[
{"id":"004", "content":"content44444444444444"},
{"id":"003", "content":"content33333333333333"},
{"id":"002", "content":"content22222222222222"},
{"id":"001", "content":"content11111111111111"}
]