1.1.0 • Published 7 years ago

grafith-is v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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)

ParameterTypeValue
valuenumberany number
oddfunctiona custom function if the number is odd
evenfunctiona custom function if the number is even