I have added a dynamic json object with javascript. the code is as follow:
if (!beadz[color.title])
beadz.push({
(color.title): {
bead.title: {
"inventoryQuantity": bead.inventory_quantity,
"currentQuantity": 1
}
}
});
However the code is not working and giving syntax error. what i am missing? kindly help.
(color.title):is invalid syntax. Did you mean[color.title]:?