var test = [0,1,2,3,4,5,6];


test.splice(2,1);


console.log(test);


결과 : [0,1,3,4,5,6]


만약 제외한 항목을 담고 싶을때는


var test = [0,1,2,3,4,5,6];


test = test.splice(2,1);


console.log(test);


결과 : [2]


제외되는 값이 리턴이 됩니다.

+ Recent posts