JSFiddle - React, Tailwind, and code Playground

JavaScript

var list = "[768.234.232, 768.234.232, 574,10-10-2012, 10-10-2012, 768.234.232, 768.234.232, 987, 10-10-2012, 10-10-2012, 124]";

list = list.slice(1,-1);                 // remove the enclosing []
var allValues = list.split(/\s*,\s*/);   // split on comma with optional whitespace
var a = [];
for (var i = 0; i < allValues.length; i+=5) {
    a.push( allValues.slice(i, i+5<=allValues.length ? i+5 : allValues.length) );
}

console.log(a);