From 8db73fe7df977c4fb59eafe99a2b66ed8bb5c7d7 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Thu, 10 Oct 2024 18:05:04 +0100 Subject: [PATCH] typescript: `Array.reduce`: permit different output to array type --- src/jswrap_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jswrap_array.c b/src/jswrap_array.c index 0e921f0dc..1b5e5d7cd 100644 --- a/src/jswrap_array.c +++ b/src/jswrap_array.c @@ -518,7 +518,7 @@ JsVar *jswrap_array_every(JsVar *parent, JsVar *funcVar, JsVar *thisVar) { ["initialValue","JsVar","if specified, the initial value to pass to the function"] ], "return" : ["JsVar","The value returned by the last function called"], - "typescript" : "reduce(callback: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;" + "typescript" : "reduce(callback: (previousValue: O, currentValue: T, currentIndex: number, array: T[]) => O, initialValue?: O): O;" } Execute `previousValue=initialValue` and then `previousValue = callback(previousValue, currentValue, index, array)` for each element in the