convert string array to array code example Example: convert matrix string to matrix javascript string = '[[1, 2], [3, 4], [5, 6]]' string = JSON.parse(string)