js forms a new array every 3 values based on the original array, and the values in it cannot be repeated
.primitive array
var result = [];
$.each(arr,function(i){
var newArr = [];
newArr.push(arr[i]);
for(var a=i; a<arrLength; aPP){
newArr.push(arr[a]);
if(arr[a+1]){
newArr.push(arr[a+1]);
}
if(newArr.length == 3){
result.push(newArr);
}
}
});
console.log(result);