diff options
Diffstat (limited to 'lib/utils.js')
-rw-r--r-- | lib/utils.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils.js b/lib/utils.js index 79039665..4d3d60f6 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -166,6 +166,12 @@ function string_template(text, props) { }); }; +function remove(array, el) { + for (var i = array.length; --i >= 0;) { + if (array[i] === el) array.splice(i, 1); + } +}; + function mergeSort(array, cmp) { if (array.length < 2) return array.slice(); function merge(a, b) { |