dist/modules/array.js
function splice(arr, start, remove) {
    var items = [];
    for (var _i = 3; _i < arguments.length; _i++) {
        items[_i - 3] = arguments[_i];
    }
    start = start || 0;
    var head = arr.slice(0, start);
    var tail = arr.slice(start);
    var removed = [];
    if (remove) {
        removed = tail.slice(0, remove);
        tail = tail.slice(remove);
    }
    if (!is_1.isValue(remove)) {
        arr = head.concat(items);
        removed = tail;
    }
    else {
        arr = head.concat(items).concat(tail);
    }
    return {
        array: arr,
        val: removed
    };
}
function splice(arr, start, remove) {
    var items = [];
    for (var _i = 3; _i < arguments.length; _i++) {
        items[_i - 3] = arguments[_i];
    }
    start = start || 0;
    var head = arr.slice(0, start);
    var tail = arr.slice(start);
    var removed = [];
    if (remove) {
        removed = tail.slice(0, remove);
        tail = tail.slice(remove);
    }
    if (!is_1.isValue(remove)) {
        arr = head.concat(items);
        removed = tail;
    }
    else {
        arr = head.concat(items).concat(tail);
    }
    return {
        array: arr,
        val: removed
    };
}
function splice ( arr , start , remove ) { var items = [ ] ; for ( var _i = 3 ; _i < arguments . length ; _i ++ ) { items [ _i - 3 ] = arguments [ _i ] ; } start = start || 0 ; var head = arr . slice ( 0 , start ) ; var tail = arr . slice ( start ) ; var removed = [ ] ; if ( remove ) { removed = tail . slice ( 0 , remove ) ; tail = tail . slice ( remove ) ; } if ( ! is_1 . isValue ( remove ) ) { arr = head . concat ( items ) ; removed = tail ; } else { arr = head . concat ( items ) . concat ( tail ) ; } return { array : arr , val : removed } ; }
Splice
Non mutating way of splicing an array.


@param arr the array to be spliced.
@param start the starting index (default: 0)
@param remove the count to be spliced (default: 1)
@param items additional items to be concatenated.
Splice Non mutating way of splicing an array .