diff --git a/src/compat/array/forEach.ts b/src/compat/array/forEach.ts index d4ec31128..d7e27ec47 100644 --- a/src/compat/array/forEach.ts +++ b/src/compat/array/forEach.ts @@ -152,8 +152,7 @@ export function forEach( return collection; } - const keys: PropertyKey[] = - isArrayLike(collection) || Array.isArray(collection) ? range(0, collection.length) : Object.keys(collection); + const keys: PropertyKey[] = isArrayLike(collection) ? range(0, collection.length) : Object.keys(collection); for (let i = 0; i < keys.length; i++) { const key = keys[i];