SOURCE

function remove(arr, item) {
    var o = item
    arr= arr.filter(function(c){
        return c != o
    })
    return arr
}
console.log(remove([1, 2, 3, 4, 2], 2))
console 命令行工具 X clear

                    
>
console