From c3d74828dcaf8f63cbac7f2e81b26cc454fc7c00 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Thu, 2 Dec 2010 10:59:20 +0000 Subject: [PATCH] new arrayRemove method --- plugins/pilot/lib/util.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/pilot/lib/util.js b/plugins/pilot/lib/util.js index 5a138a20..e0cd4bb3 100644 --- a/plugins/pilot/lib/util.js +++ b/plugins/pilot/lib/util.js @@ -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); + } + } +}; + + });