diff --git a/src/vanilla/shallow.ts b/src/vanilla/shallow.ts index 7836a912a7..54741366d9 100644 --- a/src/vanilla/shallow.ts +++ b/src/vanilla/shallow.ts @@ -37,10 +37,10 @@ export function shallow(objA: T, objB: T) { if (keysA.length !== Object.keys(objB).length) { return false } - for (let i = 0; i < keysA.length; i++) { + for (const keyA of keysA) { if ( - !Object.prototype.hasOwnProperty.call(objB, keysA[i] as string) || - !Object.is(objA[keysA[i] as keyof T], objB[keysA[i] as keyof T]) + !Object.prototype.hasOwnProperty.call(objB, keyA as string) || + !Object.is(objA[keyA as keyof T], objB[keyA as keyof T]) ) { return false }