A simple JavaScript function for converting an flat array into an array of arrays.