Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonschlinkert/array-sum
Add up all of the numbers in an array of numbers. Works when non-numbers are present as well.
https://github.com/jonschlinkert/array-sum
add array math reduce sum
Last synced: about 2 months ago
JSON representation
Add up all of the numbers in an array of numbers. Works when non-numbers are present as well.
- Host: GitHub
- URL: https://github.com/jonschlinkert/array-sum
- Owner: jonschlinkert
- License: mit
- Created: 2014-06-15T07:58:21.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-15T03:06:39.000Z (almost 10 years ago)
- Last Synced: 2024-11-02T10:11:32.645Z (2 months ago)
- Topics: add, array, math, reduce, sum
- Language: JavaScript
- Homepage: https://github.com/jonschlinkert
- Size: 124 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# array-sum [![NPM version](https://badge.fury.io/js/array-sum.svg)](http://badge.fury.io/js/array-sum)
> Add up all of the numbers in an array of numbers. Works when non-numbers are present as well.
## Install
### Install with [npm](npmjs.org):```bash
npm i array-sum --save-dev
```## Usage
```js
var arraySum = require('array-sum');arraySum([1, 2, 3, 4, 5]);
//=> 15arraySum(['1', '2', 3, '4', 5]);
//=> 15arraySum([1, 'foo', 2, 3, 4, {}, 5]);
//=> 15
```## Author
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)## License
Copyright (c) 2014-2015 Jon Schlinkert
Released under the MIT license***
_This file was generated by [verb](https://github.com/assemble/verb) on January 14, 2015._