grafith-is
v1.1.0
Published
This is a lib to know if a number is even. (is a joke with the brazilian band: Grafith)
Downloads
7
Maintainers
Readme
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 |