I have this JSON file on my server:
{"1504929411112":{"name":"user1","score":"10"},"1504929416574":{"name":"2nduser","score":"14"},"1504929754610":{"name":"usr3","score":"99"},"1504929762722":{"name":"userfour","score":"40"},"1504929772310":{"name":"user5","score":"7"}}
Assuming I have parsed this file:
var json = JSON.parse(getJSONFile());
How can I now sort each object in the json
variable by the score
property?
None of the array sorting functions work for me as json
is not an array.