From 4a3ac9a041dc413b0f911dbc71bbc1461456c75c Mon Sep 17 00:00:00 2001 From: Antoliny0919 Date: Fri, 10 Jul 2026 15:03:58 +0900 Subject: [PATCH] fix(compat/forEach): remove redundant array check in key resolution --- src/compat/array/forEach.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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];