array-reduce

WebJar for array-reduce

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

array-reduce
Last Version

Last Version

0.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

array-reduce
WebJar for array-reduce
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/substack/array-reduce

Download array-reduce

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/array-reduce/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>array-reduce</artifactId>
    <version>0.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/array-reduce/
implementation 'org.webjars.npm:array-reduce:0.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/array-reduce/
implementation ("org.webjars.npm:array-reduce:0.0.0")
'org.webjars.npm:array-reduce:jar:0.0.0'
<dependency org="org.webjars.npm" name="array-reduce" rev="0.0.0">
  <artifact name="array-reduce" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='array-reduce', version='0.0.0')
)
libraryDependencies += "org.webjars.npm" % "array-reduce" % "0.0.0"
[org.webjars.npm/array-reduce "0.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

array-reduce

[].reduce() for old browsers

testling badge

build status

example

var reduce = require('array-reduce');
var xs = [ 1, 2, 3, 4 ];
var sum = reduce(xs, function (acc, x) { return acc + x }, 0);
console.log(sum);

output:

10

methods

var reduce = require('array-reduce')

var res = reduce(xs, f, init)

Create a result res by folding acc = f(acc, xs[i], i) over each element in the array xs at element i. If init is given, the first acc value is init, otherwise xs[0] is used.

install

With npm do:

npm install array-reduce

license

MIT

Versions

Version
0.0.0