I have a json file like
var data = {
"list":[
{
"g": "zas",
"e": "wef"
},
{
"g": "abc",
"e": "ew"
},
{
"g": "wee",
"e": "asd"
},.....
How do I sort the entries w.r.t “g”
so that I get abc then wee and then zas….
I want the sort changes permanently in the json file
In JavaScript, you can use a custom comparator function to sort an array like so:
Array.sort@ MDC