In javascript, how to split an array into chunks by breaks? For example,
var array = [0,1,2,3,4,5,6,7,8,9,12,13,15,20]
var breaks = [0,3.5,13]
somefunction(array, breaks) === [[0,1,2,3],[4,5,6,7,8,9,12],[13,15,20]]
// true
The value in breaks does not necessarily in the array.