msngr.js
function(arr, value) {
        var inx = arr.indexOf(value);
        var endIndex = arr.length - 1;
        if (inx !== endIndex) {
            var temp = arr[endIndex];
            arr[endIndex] = arr[inx];
            arr[inx] = temp;
        }
        arr.pop();
    }
function(arr, value) {
        var inx = arr.indexOf(value);
        var endIndex = arr.length - 1;
        if (inx !== endIndex) {
            var temp = arr[endIndex];
            arr[endIndex] = arr[inx];
            arr[inx] = temp;
        }
        arr.pop();
    }
function ( arr , value ) { var inx = arr . indexOf ( value ) ; var endIndex = arr . length - 1 ; if ( inx !== endIndex ) { var temp = arr [ endIndex ] ; arr [ endIndex ] = arr [ inx ] ; arr [ inx ] = temp ; } arr . pop ( ) ; }
A more efficient element removal from an array in cases where the array is large
A more efficient element removal from an array in cases where the array is large