new arrayRemove method
This commit is contained in:
parent
e544ad30fc
commit
c3d74828dc
1 changed files with 13 additions and 1 deletions
|
|
@ -656,4 +656,16 @@ exports.rectsEqual = function(r1, r2, delta) {
|
||||||
return true;
|
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