SOURCE

// method_1:普通for循环+splice
function removeWithoutCopy(arr, item) {
    for (let i = arr.length; i >= 0; i--) {
        if (arr[i] == item) {
            arr.splice(i, 1);
        }
    }
    return arr;
}
console 命令行工具 X clear

                    
>
console