Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var data = [{"2014-11-18":1},{"2014-11-19":0},{"2014-11-20":0},{"2014-11-21":0},{"2014-11-22":0},{"2014-11-23":0},{"2014-11-24":0}];
var dateToArray = function(json_object) {
    var dayArray = [],
        key;
  
    for (var i = 0; i < json_object.length; i++) {
        key = Object.keys(json_object[i])[0];
            
        dayArray.push({
            "Date" : key,
            "Count" : json_object[i][key]
        });
    }
  
    return dayArray;
};
console.log(dateToArray(data));
Output

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

Dismiss x
public
Bin info
_alexander_pro
0viewers