abs-array

1.0.0 • Public • Published

abs-array

A JavaScript Package For Converting Negative Value To Positive. Also works when non-numbers are present as well.

npm license github-issues

nodei.co

travis-status stars forks

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 prosenghosh25@gmail.com

License

  • MIT

Package Sidebar

Install

npm i abs-array

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • prosen-ghosh