@thelocalgodd/isprime
v1.0.2
Published
A simple package to check if a number is prime.
Downloads
207
Readme
Prime Number Checker
A simple package to check if a number is prime.
installation
npm i @thelocalgodd/isprime
usage
const { isPrime } = require('@thelocalgodd/isprime');
console.log(isPrime(17)); // true
console.log(isPrime(4)); // false
API
isPrime(num)
Returns true
if the number is prime, false
otherwise.
Parameters
num
(number): The number to check
Returns
- (boolean):
true
if the number is prime,false
otherwise
License
MIT