I have use generate the javascript multiple object based my page result, then convert to JSON string. but JSON.stringify not display properly. I don't know why display like this. I have added example of my coding
var sample_object = [];
var sub_array = [];
sub_array["type"] = 'I';
sample_object.push(sub_array);
console.log(sample_object);
console.log(JSON.stringify(sample_object));
Result :-
[Array[0]]
0: Array[0]
length: 0
type: "I"_
_proto__: Array[0]
length: 1__proto__:
Array[0]
JSON.stringify Output
[[]]
Thanks in advance!
sub_array["type"] = 'I';This statement will have no effect