mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Apply more let/const transforms.
This commit is contained in:
@@ -34,8 +34,8 @@ import toKey from './_toKey.js';
|
||||
function result(object, path, defaultValue) {
|
||||
path = castPath(path, object);
|
||||
|
||||
var index = -1,
|
||||
length = path.length;
|
||||
let index = -1;
|
||||
let length = path.length;
|
||||
|
||||
// Ensure the loop is entered when path is empty.
|
||||
if (!length) {
|
||||
@@ -43,7 +43,7 @@ function result(object, path, defaultValue) {
|
||||
object = undefined;
|
||||
}
|
||||
while (++index < length) {
|
||||
var value = object == null ? undefined : object[toKey(path[index])];
|
||||
let value = object == null ? undefined : object[toKey(path[index])];
|
||||
if (value === undefined) {
|
||||
index = length;
|
||||
value = defaultValue;
|
||||
|
||||
Reference in New Issue
Block a user