abs-array
v1.0.0
Published
A JavaScript Package For Converting Negative Value To Positive. Also works when non-numbers are present as well.
Downloads
1
Maintainers
Readme
abs-array
A JavaScript Package For Converting Negative Value To Positive. Also works when non-numbers are present as well.
Features
npm
Install
npm install --save abs-array
Script Tag
For Development
<script src="https://rawgit.com/Prosen-Ghosh/abs-array/master/abs.js"></script>
For Production
<script src="https://cdn.rawgit.com/Prosen-Ghosh/abs-array/fee489fb/abs.js"></script>
Usage
const abs = require('abs-array');
abs([-1,-2,5,6,8,-7]);
//=> [ 1, 2, 5, 6, 8, 7 ]
abs([-1,-2,"foo",{},[]])
//=> [ 1, 2, 'foo', {}, [] ]
abs([-1,-2,"foo",{},[],-100])
//=> [ 1, 2, 'foo', {}, [], 100 ]
abs(); // Without parameter function will return a type error
//=> TypeError: abs() expects an array parameter
Author
Prosen Ghosh [email protected]
License
- MIT