new arrayRemove method

This commit is contained in:
Joe Walker 2010-12-02 10:59:20 +00:00
commit c3d74828dc

View file

@ -36,7 +36,7 @@
* ***** END LICENSE BLOCK ***** */
define(function(require, exports, module) {
/**
* Create an object representing a de-serialized query section of a URL.
* Query keys with multiple values are returned in an array.
@ -656,4 +656,16 @@ exports.rectsEqual = function(r1, r2, delta) {
return true;
};
/**
* splice out of 'array' anything that === 'value'
*/
exports.arrayRemove = function(array, value) {
for (var i = 0; i <= array.length; i++) {
if (value === array[i]) {
array.splice(i, 1);
}
}
};
});