Skip to content

Commit b954a9f

Browse files
authored
Merge pull request #2566 from bobrippling/types/reduce
typescript: `Array.reduce`: permit different output to array type
2 parents ea96724 + 8db73fe commit b954a9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jswrap_array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ JsVar *jswrap_array_every(JsVar *parent, JsVar *funcVar, JsVar *thisVar) {
518518
["initialValue","JsVar","if specified, the initial value to pass to the function"]
519519
],
520520
"return" : ["JsVar","The value returned by the last function called"],
521-
"typescript" : "reduce(callback: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;"
521+
"typescript" : "reduce<O>(callback: (previousValue: O, currentValue: T, currentIndex: number, array: T[]) => O, initialValue?: O): O;"
522522
}
523523
Execute `previousValue=initialValue` and then `previousValue =
524524
callback(previousValue, currentValue, index, array)` for each element in the

0 commit comments

Comments
 (0)