Skip to content

Commit 8880cde

Browse files
committed
Fix array.flatMap
1 parent 45ed744 commit 8880cde

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lualib/ArrayFlatMap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function __TS__ArrayFlatMap<T, U>(
44
callback: (value: T, index: number, array: T[]) => U | readonly U[]
55
): U[] {
66
const result: U[] = [];
7-
let len = 1;
7+
let len = 0;
88
for (const i of $range(1, array.length)) {
99
const value = callback(array[i - 1], i - 1, array);
1010
if (Array.isArray(value)) {

0 commit comments

Comments
 (0)