Currently, I'm dealing with an array that is stored in string format,
var str = {
id: 123,
changes: "[[atr:test1, old:null, new:null], [atr:messageText, old:test here, new:hello test], [atr:status, old:null, new:1]]"
}
var d = str.changes
I've attempted different methods to convert the 'changes' array from its string format, including using split()
, replace()
, slice()
, and even JSON.parse()
, but all my efforts have been unsuccessful so far.
Do you know of any effective way to transform this into a javascript array?