1var maxSpeed = {
2 car: 300,
3 bike: 60,
4 motorbike: 200,
5 airplane: 1000,
6 helicopter: 400,
7 rocket: 8 * 60 * 60
8};
9var sortable = [];
10for (var vehicle in maxSpeed) {
11 sortable.push([vehicle, maxSpeed[vehicle]]);
12}
13
14sortable.sort(function(a, b) {
15 return a[1] - b[1];
16});
17
18//[["bike", 60], ["motorbike", 200], ["car", 300],
19//["helicopter", 400], ["airplane", 1000], ["rocket", 28800]]
20