1.1.0 • Published 7 years ago
grafith-is v1.1.0
Description
This is a lib to know if a number is even. (is a joke with the brazilian band: Grafith)
Usage
const is = require('grafith-is');
is(3);
Result:
Você chupa
If you need a customizable result:
const is = require('grafith-is');
is(3, odd_fn, even_fn('params'));
function odd_fn() {
console.log('own function');
}
function even_fn(parameter) {
console.log(`own function with ${parameter}`);
}
API
is(value, odd, even)
Parameter | Type | Value |
---|---|---|
value | number | any number |
odd | function | a custom function if the number is odd |
even | function | a custom function if the number is even |