trunk/research/players/js/winlin.utility.js
/**
 * extends system array, to remove all specified elem.
 * @param arr the array to remove elem from.
 * @param elem the elem to remove.
 * @remark all elem will be removed.
 * for example,
 *      arr = [10, 15, 20, 30, 20, 40]
 *      system_array_remove(arr, 10) // arr=[15, 20, 30, 20, 40]
 *      system_array_remove(arr, 20) // arr=[15, 30, 40]
 */
extends system array, to remove all specified elem.
@param arr the array to remove elem from.
@param elem the elem to remove.
@remark all elem will be removed.
extends system array to remove all specified elem . @param arr the array to remove elem from . @param elem the elem to remove . @remark all elem will be removed .
function system_array_remove(arr, elem) {
    if (!arr) {
        return;
    }
    var removed = true;
    var i = 0;
    while (removed) {
        removed = false;
        for (; i < arr.length; i++) {
            if (elem == arr[i]) {
                arr.splice(i, 1);
                removed = true;
                break;
            }
        }
    }
}
function system_array_remove ( arr , elem ) { if ( ! arr ) { return ; } var removed = true ; var i = 0 ; while ( removed ) { removed = false ; for ( ; i < arr . length ; i ++ ) { if ( elem == arr [ i ] ) { arr . splice ( i , 1 ) ; removed = true ; break ; } } } }
extends system array, to remove all specified elem.
extends system array to remove all specified elem .