diff --git a/lodash.js b/lodash.js index 4d11ee849..31c3d2776 100644 --- a/lodash.js +++ b/lodash.js @@ -3881,14 +3881,8 @@ var previous = index; if (isIndex(index)) { splice.call(array, index, 1); - } - else { - var path = castPath(index, array), - object = parent(array, path); - - if (object != null) { - delete object[toKey(last(path))]; - } + } else { + baseUnset(array, index); } } } @@ -4352,8 +4346,7 @@ function baseUnset(object, path) { path = castPath(path, object); object = parent(object, path); - var key = toKey(last(path)); - return !(object != null && hasOwnProperty.call(object, key)) || delete object[key]; + return object == null || delete object[toKey(last(path))]; } /**