Use const and let for var declaration in baseEach and baseEachRight.

This commit is contained in:
Michał Lipiński
2017-03-12 19:53:08 +01:00
parent 3b302b822c
commit 3e03cbf2b8
2 changed files with 5 additions and 5 deletions

View File

@@ -16,9 +16,9 @@ function baseEach(collection, iteratee) {
if (!isArrayLike(collection)) {
return baseForOwn(collection, iteratee)
}
var length = collection.length,
index = -1,
iterable = Object(collection)
const length = collection.length
const iterable = Object(collection)
let index = -1
while (++index < length) {
if (iteratee(iterable[index], index, iterable) === false) {

View File

@@ -16,8 +16,8 @@ function baseEachRight(collection, iteratee) {
if (!isArrayLike(collection)) {
return baseForOwnRight(collection, iteratee)
}
var length = collection.length,
iterable = Object(collection)
const iterable = Object(collection)
let length = collection.length
while (length--) {
if (iteratee(iterable[length], length, iterable) === false) {