diff --git a/src/array/replace.ts b/src/array/replace.ts index 6855b275..11fe568b 100644 --- a/src/array/replace.ts +++ b/src/array/replace.ts @@ -20,8 +20,7 @@ export function replace( } const out = array.slice() for (let index = 0; index < array.length; index++) { - const item = array[index] - if (match(item, index)) { + if (match(array[index], index)) { out[index] = newItem break }