What would be the best way to go about separating the key and values into two different arrays so that this -
var data = {\"A Key\": 34, \"Another Key\": 16
You can loop through the properties with a for in
loop, and then just assign them to arrays as needed.
Make sure you check whether the key is a property of the object, and not of the prototype.
var data1 = [];
var data2 = [];
for (var key in p) {
if (p.hasOwnProperty(key)) {
data1.push(key);
data2.push(p[key]);
}
}