I have a json-dump
data from Django
view -
{"7": {"1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, "10": 0, "11": 1, "12": 0}}
I need an array in javascript
from the json
data like -
var list = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]
Also I need the key "7". No jQuery
but javascript
Here is so far I tried -
var json_data = JSON.parse({{ vote_records }});
json_data.forEach(function(entry) {
console.log(entry);
});
What is the best way?