I need to make this array into one string - quotation marks around the whole thing - not affecting the individual elements - therefore JSON.stringify doesnt work.
[ { name: 'red', id: '1' },
{ name: 'yellow', id: '2' },
{ name: 'black', id: '3' },
{ name: 'white', id: '4' } ]
needs to be
"[ { name: 'red', id: '1' },
{ name: 'yellow', id: '2' },
{ name: 'black', id: '3' },
{ name: 'white', id: '4' } ]"
I do not want to make every element of the array a string, I just want to put quotation marks around the whole thing. I've tried doing arr.join() and i just get '[object Object],[object Object],[object Object],[object Object]' Is there a simple way of doing this?