I've been trying to stringify a javascript array which is keyed by strings. JSON always stringifies the array as empty ([]
).
var arr = new Array(3);
arr['A'] = "Foo";
arr['B'] = "Bar";
arr['C'] = "Baz";
var str = JSON.stringify(arr);
If I replace the 'A', 'B', 'C' with 0,1,2 then the array is stringified correctly. I'm sure I'm missing something, just not sure what.
Thanks!