Skip to content

Commit

Permalink
Use const for key in hasPath.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Mar 2, 2017
1 parent a2fe303 commit e7bbcfa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions .internal/hasPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ import toKey from './toKey.js'
function hasPath(object, path, hasFunc) {
path = castPath(path, object)

let key
let index = -1
let length = path.length
let result = false

while (++index < length) {
key = toKey(path[index])
const key = toKey(path[index])
if (!(result = object != null && hasFunc(object, key))) {
break
}
Expand Down

0 comments on commit e7bbcfa

Please sign in to comment.