var data = '[1, 2][3, 6]'; var arr = (new Function('return [' + data.replace('][', '], [') + ']'))(); console.log(arr);