0

My function:

sort: function (jsonData) {
    return jsonData.sort(function(a,b){
        return (a < b.id) ? -1:1;
    });
},

The error msg: TypeError: jsonData.sort is not a function.
JsonData example value:

Object{
131:Object
132:Object
136:Object
139:Object
142:Object
143:Object
144:Object
}

I need reverse sort of jsonData object.
This is not duplicate of Sorting JavaScript Object by property value. Because they are sorting by value, but i need sorting by key.

Community
  • 1
  • 1

0 Answers0