Im trying to create an associative array with objects, the key should always be a string (but they are always numbers). This is how i store them (recording user clicks):
App.Recording[currentTime.toString()] = {sound: buttonName.toLowerCase() };
When trying to do this:
var save = {};
save.recording = App.Recording;
console.log(JSON.stringify(save));
I get this:
{"recording":[null, null,{"sound":"e"},null,null,null,.......,null,null,null,null,{"sound":"e"},....,null, null...]}
So, the toString()
doesnt work on currentTime.toString()
, which make my array store currentTime
as numbers instead...
How can I save the objects and have an associative array?