js移除数组中指导位置元素

js移除数组中指导位置元素,包括一个对象


//在数组中移除指定位置的元素,返回删除指定元素后的数组
    function RemoveAt(arr, position)
    {
        var items = new Array();
        if (position >= arr.length)
            alert("out off the array's max length");
        items = arr.slice(0, position).concat(arr.slice(position + 1, arr.length));
        return items;
    }

posted @ 2008-10-11 17:59  落叶潇潇雨  阅读(667)  评论(0编辑  收藏  举报