new arrayRemove method
This commit is contained in:
parent
e544ad30fc
commit
c3d74828dc
1 changed files with 13 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue