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