Skip to content

Commit

Permalink
Merge pull request #2566 from bobrippling/types/reduce
Browse files Browse the repository at this point in the history
typescript: `Array.reduce`: permit different output to array type
  • Loading branch information
gfwilliams authored Oct 11, 2024
2 parents ea96724 + 8db73fe commit b954a9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jswrap_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -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<O>(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
Expand Down

0 comments on commit b954a9f

Please sign in to comment.