{"_id":"arr-reduce","_rev":"86668","name":"arr-reduce","description":"Fast array reduce that also loops over sparse elements.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:28:08.000Z","created":"2015-01-26T11:16:35.845Z","1.0.1":"2015-03-24T06:15:21.285Z","1.0.0":"2015-01-26T11:16:35.845Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/arr-reduce.git"},"versions":{"1.0.1":{"name":"arr-reduce","description":"Fast array reduce that also loops over sparse elements.","version":"1.0.1","homepage":"https://github.com/jonschlinkert/arr-reduce","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/arr-reduce.git"},"bugs":{"url":"https://github.com/jonschlinkert/arr-reduce/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/arr-reduce/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*","should":"^5.2.0"},"keywords":["array","reduce"],"gitHead":"5b1a3a5b4d3bee14b2da2788fe5228257aab7f8e","_id":"arr-reduce@1.0.1","_shasum":"1d26bf6bf6f58810341c79d1942d77d18dc3a365","_from":".","_npmVersion":"2.7.1","_nodeVersion":"1.6.2","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"1d26bf6bf6f58810341c79d1942d77d18dc3a365","size":2139,"noattachment":false,"key":"/arr-reduce/-/arr-reduce-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/arr-reduce/download/arr-reduce-1.0.1.tgz"},"directories":{},"publish_time":1427177721285,"_cnpm_publish_time":1427177721285,"_hasShrinkwrap":false},"1.0.0":{"name":"arr-reduce","description":"Fast array reduce that also loops over sparse elements.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/arr-reduce","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/arr-reduce.git"},"bugs":{"url":"https://github.com/jonschlinkert/arr-reduce/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/arr-reduce/blob/master/LICENSE-MIT"},"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"dependencies":{"is-number":"^1.1.0"},"devDependencies":{"mocha":"*","should":"^4.6.1"},"keywords":["array","reduce"],"gitHead":"508eceff27f3a2fc7a48dfee41608dcc909f382c","_id":"arr-reduce@1.0.0","_shasum":"6a32b02659c804506264dbf783e655060a63799e","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"6a32b02659c804506264dbf783e655060a63799e","size":3327,"noattachment":false,"key":"/arr-reduce/-/arr-reduce-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/arr-reduce/download/arr-reduce-1.0.0.tgz"},"directories":{},"publish_time":1422270995845,"_cnpm_publish_time":1422270995845,"_hasShrinkwrap":false}},"readme":"# arr-reduce [![NPM version](https://badge.fury.io/js/arr-reduce.svg)](http://badge.fury.io/js/arr-reduce)  [![Build Status](https://travis-ci.org/jonschlinkert/arr-reduce.svg)](https://travis-ci.org/jonschlinkert/arr-reduce) \n\n> Fast array reduce that also loops over sparse elements.\n\n## Install with [npm](npmjs.org)\n\n```bash\nnpm i arr-reduce --save\n```\n\n## Usage\n\n**Callback params**\n\nThe callback is executed on every element in the supplied array:\n\n - `prev`: this is the \"accumulator\". This value is either the result of the last callback invocation, or the initial value if specified.\n - `curr`: the current array element being looped over\n - `i`: the index of the current element\n - `arr`: the array that is being looped over.\n\n**Examples**\n\n```js\nvar reduce = require('arr-reduce');\n\nreduce([1, 2, 3, 4, 5], function (prev, curr) {\n  return prev + curr;\n});\n//=> '15'\n```\n\nPass an initial value:\n\n```js\nreduce(['b', 'c'], function (prev, curr) {\n  return prev.concat(curr);\n}, ['a']);\n\n//=> ['a', 'b', 'c']\n```\n\n## Run tests\n\nInstall dev dependencies:\n\n```bash\nnpm i -d && npm\n```\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/arr-reduce/issues)\n\n## Author\n\n**Jon Schlinkert**\n \n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) \n\n## License\nCopyright (c) 2015 Jon Schlinkert  \nReleased under the MIT license\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 24, 2015._","_attachments":{},"homepage":"https://github.com/jonschlinkert/arr-reduce","bugs":{"url":"https://github.com/jonschlinkert/arr-reduce/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/arr-reduce/blob/master/LICENSE"}}