var last =-1;
var結果=[];
for(var I = 0;我& lt列表.長度;i++){
if(I = = 0 & amp;& amplast==-1){
last = list[i]
result . push(list[I]);
繼續;
}
var temp = list[I];
if(temp!=最後){
last = temp
console.log(結果);