diff options
Diffstat (limited to 'lib/utils.js')
-rw-r--r-- | lib/utils.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/utils.js b/lib/utils.js index 4a61623a..40b65e2a 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -172,9 +172,8 @@ function string_template(text, props) { } function remove(array, el) { - for (var i = array.length; --i >= 0;) { - if (array[i] === el) array.splice(i, 1); - } + var index = array.indexOf(el); + if (index >= 0) array.splice(index, 1); } function makePredicate(words) { |