Is there an easy way to take a string like the one below into an array without writing some kind of complicated parsing function?
const stringArray = '[{key1: 'value1', key2: 'value 2'}, {key1: 'value3', key2: 'value4'}, {key1: 'value5', key2: 'value6'}]';
I want to be able to do something like:
const arr = <stringArray CONVERTED TO ARRAY>;
console.log(arr[1].key1); // should log 'value3'
If context helps, I'm writing a utility program in JavaScript that involves grabbing and parsing an array input into a <textarea> by the user.
JSON.parseit easily