I have a json code as below:
[
[
{
"title":"Shirt Front",
"thumbnail":"http://ipadd/pub/media/catalog/product//b/l/blue-back_2.jpg",
"elements":[
{
"type":"image",
"source":"http://ipadd/pub/media/catalog/product//b/l/blue-back_2.jpg",
"title":"Base",
"parameters":{
"left":325,
"top":329,
"colors":"#d59211",
"price":20,
"colorLinkGroup":"Base",
"fill":false
}
}
]
},
{
"title":"Shirt Front",
"thumbnail":"http://ipadd/pub/media/catalog/product//b/l/blue-back_1_1.jpg",
"elements":[
{
"type":"image",
"source":"ipadd/pub/media/catalog/product//b/l/blue-back_1_1.jpg",
"title":"Base",
"parameters":{
"left":325,
"top":329,
"colors":"#d59211",
"price":20,
"colorLinkGroup":"Base",
"fill":false
}
}
]
},
]
]
I need to remove the comma at the end of array ie. the comma before the last two characters of the json. Due to this the above json is a invalid json. I need to achieve this using JS.
JSON.stringify.