Skip to content

seangenabe/iif

Repository files navigation

iif

The IIf function in Javascript

npm Build Status Coverage Status

Usage

iif(condition, ifTrue, [ifFalse])

var iif = require('iif')

Returns ifTrue if condition is truthy. Otherwise, returns ifFalse.

iifBranch(condition, ifTrueFunc, [ifFalseFunc])

var iif = require('iif/branch')

Same as above, but additionally calls the argument being returned if it's a function.

License

CC0-1.0