Socket
Book a DemoInstallSign in
Socket

array-reduce-right

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-reduce-right

Array#reduceRight ponyfill for older browsers

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

array-reduce-right

Build Status NPM package Bower package Dependency Status License

Array#reduceRight ponyfill for older browsers

Ponyfill: A polyfill that doesn't overwrite the native method

DESCRIPTION

Provides reduceRight function for older browsers, use native implememtation if exists.

It's just like

EXAMPLE

var total = reduceRight([3, 2, 24], function (a, b) {
    return a / b;
});
assert.equal(total, 4);

var flattened = reduceRight([[0, 1], [2, 3], [4, 5]], function (a, b) {
    return a.concat(b);
}, []);
assert.deepEqual(flattened, [4, 5, 2, 3, 0, 1]);

INSTALL

via npm

Install

$ npm install --save array-reduce-right

Use

var reduceRight = require('array-reduce-right');

use array-reduce-right npm module on browser

reduceRight function is exported

<script type="text/javascript" src="./path/to/node_modules/array-reduce-right/build/array-reduce-right.js"></script>

via bower

Install

$ bower install --save array-reduce-right

Load (reduceRight function is exported)

<script type="text/javascript" src="./path/to/bower_components/array-reduce-right/build/array-reduce-right.js"></script>

Use

var total = reduceRight([3, 2, 24], function (a, b) {
    return a / b;
});

AUTHOR

LICENSE

Licensed under the MIT license.

Keywords

array

FAQs

Package last updated on 23 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts