(21/60) Refer to the code snippet below:Let array = [1, 2, 3, 4, 4, 5, 4, 4];For (let i =0; i < array.length; i++){if (array[i] === 4) {array.splice(i, 1);}}What is the value of the array after the code executes?
let array = [1, 2, 3, 4, 4, 5, 4, 4]; for (let i=0; i < array.length; i++){ if (array[i] === 4) { console.log(i); array.splice(i, 1); console.log(array); } } console.log(array); https://mine-it-record.tistory.com/352 [JavaScript] arr.splice() - 배열 데이터 추가/제거/교체/추출 하기 Array.prototype.splice() 메서드는 배열의 기존 요소를 삭제 또는 교체하거나 새 요소를 추가하여 배열의 내용을 변경한다. 한마디로 splice() 메서드를 가지고 push/pop/unshift/shift 역할을 다 할..