From 698956e130e613bdf54b55455847993bc44ba28c Mon Sep 17 00:00:00 2001 From: jdalton Date: Fri, 15 May 2015 08:55:47 -0700 Subject: [PATCH] Move `parseFloat` into `isIndex`. [closes #1209] --- lodash.src.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 22117a44b..ff2dc71ff 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -2669,7 +2669,7 @@ function basePullAt(array, indexes) { var length = array ? indexes.length : 0; while (length--) { - var index = parseFloat(indexes[length]); + var index = indexes[length]; if (index != previous && isIndex(index)) { var previous = index; splice.call(array, index, 1); @@ -4268,7 +4268,7 @@ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { - value = +value; + value = typeof value == 'number' ? value : parseFloat(value); length = length == null ? MAX_SAFE_INTEGER : length; return value > -1 && value % 1 == 0 && value < length; }