js = {
p1: {
qq: "qq_val",
},
p2: [{
qq: "qq_val",
}]
};
json = JSON.stringify(js);
console.log(json); // {"p1":{"qq":"qq_val"},"p2":[{"qq":"qq_val"}]}
Well, I just wanted to give the property a name, so it would not be empty, I tried something like:
js = {
p1: {
qq: "qq_val",
},
p2: [prop_name:{ // aqui eu coloco o nome da propriedade.
qq: "qq_val",
}]
};
json = JSON.stringify(js);
console.log(json); // {"p1":{"qq":"qq_val"},"p2":[{"qq":"qq_val"}]}
But you acknowledge the error, see: link
Maybe I'm shuffling some concepts (even if basic), I hope a light of you to understand better, I'm very confused ..