src/hg/js/utils.js 1.30
1.30 2010/05/24 20:42:20 tdreszer
Added support for aryRemoveVals() to subtrack 1 array from another
Index: src/hg/js/utils.js
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/js/utils.js,v
retrieving revision 1.29
retrieving revision 1.30
diff -b -B -U 4 -r1.29 -r1.30
--- src/hg/js/utils.js 16 Mar 2010 00:36:32 -0000 1.29
+++ src/hg/js/utils.js 24 May 2010 20:42:20 -0000 1.30
@@ -261,8 +261,18 @@
}
return -1;
}
+function aryRemoveVals(ary,vals)
+{ // removes one or more variables that are found in the array
+ for(var vIx=0;vIx<vals.length;vIx++) {
+ var ix = aryFind(ary,vals[vIx]);
+ if(ix != -1)
+ ary.splice(ix,1);
+ }
+ return ary;
+}
+
function aryRemove(ary,val)
{ // removes one or more variables that are found in the array
for(var vIx=1;vIx<arguments.length;vIx++) {
var ix = aryFind(ary,arguments[vIx]);