I have the map posted below in the code section. what i want to achieve is, to sort the map according to the values ascendingly. so that, after sorting it, i should the map sorted as shown in last section.
please let me know how can i achieve that.
code:
const map = {};
map['test.truck'] = 10;
map['test.domain'] = -20;
map['test.institute'] = 0;
map['test.vehicle'] = 40;
map['test.lan'] = 1;
map['test.wifi'] = 9;
after sorting:
map['test.domain'] = -20;
map['test.institute'] = 0;
map['test.lan'] = 1;
map['test.wifi'] = 9;
map['test.truck'] = 10;
map['test.vehicle'] = 40;