1.0.0 • Published 7 years ago

abs-array v1.0.0

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

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