prime-array
v1.0.0
Published
A JavaScript package for getting all prime numbers from an array.
Downloads
6
Maintainers
Readme
prime-array
A JavaScript package for getting all prime numbers from an array.
Features
Install
npm install --save prime-array
Usage
const primeArray = require('prime-array');
primeArray([1,2,3,4,5,6,7,8,9,10]);
//=> [ 2, 3, 5, 7 ]
primeArray([]);
//=> ]
primeArray(); // without parameter this
//=> TypeError: expects an Array got undefined
primeArray([{},1,2,3,4,5,6,7,8,9,10]);
//=> TypeError: expect number got object
Author
Prosen Ghosh [email protected] (https://bd.linkedin.com/in/prosen-ghosh-baba9aa8)
License
- MIT