UNPKG
evenoddcheck
Version:
latest (1.0.1)
1.0.1
1.0.0
A package that quickly sorts even and odd numbers based on input
evenoddcheck
/
index.js
13 lines
(12 loc)
•
218 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict'
;
module
.
exports
=
(
n
)=>
{
if
(n && !
isNaN
(n)){
if
(n%
2
==
0
){
return
"even"
}
else
{
return
"odd"
} }
else
{
return
"not a valid input"
} };