sort object properties and JSON.stringify

后端 未结 22 2276
南方客
南方客 2020-11-28 05:44

My application has a large array of objects, which I stringify and save them to the disk. Unfortunately, when the objects in the array are manipulated, and sometimes replac

22条回答
  •  清酒与你
    2020-11-28 06:05

    There is Array.sort method which can be helpful for you. For example:

    yourBigArray.sort(function(a,b){
        //custom sorting mechanism
    });
    

提交回复
热议问题