Skip to content
#

series

Here are 401 public repositories matching this topic...

rubico
richytong
richytong commented Oct 1, 2020

Syntax

var T any,
  args ...any,
  accumulator any,
  reducer (any, T)=>any,
  init (...args=>accumulator)|accumulator

reduce.sync(reduce, init?)(...args) -> any

Synchronous reduce without promise handling. Only for arrays (for now)

const add = (a, b) => a + b

console.log(
  reduce.sync(add, 0)([1, 2, 3, 4, 5]),
) // 15
  1. Implement

Improve this page

Add a description, image, and links to the series topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the series topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.