Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
</body>
</html>
 
(function() {
  var data = {
    "10001":{
        "unitname":"Fort Worth",
        "discounts":{"12-02-2012":"34.810000","12-03-2012":"20.810000","12-04-2012":"27.040000"},
        "gross":{"12-02-2012":"56.730000","12-03-2012":"19.350000","12-04-2012":"66.390000"},
        "net":{"12-02-2012":"61.920000","12-03-2012":"98.540000","12-04-2012":"39.350000"},
        "discounts_total":82.66,
        "gross_total":82.47,
        "net_total":99.81,
        "number":10001
    },
    "10002":{
        "unitname":"Dallast",
        "discounts":{"12-02-2012":"12.600000","12-03-2012":"25.780000","12-04-2012":"47.780000","12-05-2012":"45.210000"},
        "gross":{"12-02-2012":"29.370000","12-03-2012":"91.110000","12-04-2012":"60.890000","12-05-2012":"51.870000"},
        "net":{"12-02-2012":"16.770000","12-03-2012":"65.330000","12-04-2012":"13.110000","12-05-2012":"06.660000"},
        "discounts_total":131.37,
        "gross_total":33.24,
        "net_total":101.87,
        "number":10002
    },
    "32402":{
        "unitname":"Austin",
        "discounts":{"12-05-2012":"52.890000","12-02-2012":"22.430000","12-03-2012":"58.420000","12-04-2012":"53.130000"},
        "gross":{"12-05-2012":"25.020000","12-02-2012":"2836.010000","12-03-2012":"54.740000","12-04-2012":"45.330000"},
        "net":{"12-04-2012":"92.200000","12-05-2012":"72.130000","12-02-2012":"13.580000","12-03-2012":"96.320000"},
        "discounts_total":186.87,
        "gross_total":161.1,
        "net_total":174.23,
        "number":32402
    }
};
  var array = [];
  $.each(data, function(key, value) {
      array.push(value);
  });
  array.sort(function(a, b) {
      return a.net_total - b.net_total;
  });
  $.each(array, function(index, entry) {
    display("Entry " + index + ": " +
            entry.net_total);
  });
  function display(msg) {
    $("<p>").html(String(msg)).appendTo(document.body);
  }
  
})();
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers