logical-or
v0.1.4
Published
Binary logical OR operator (||) as an auto-curried function.
Downloads
17
Maintainers
Readme
logical-or
Binary logical OR operator (||) as an auto-curried function.
npm install logical-or --save
You can also use Duo, Bower or download the files manually.
npm stats
Overview
Returns expr1
if it can be converted to true; otherwise, returns expr2
. Thus, when used with Boolean values, || returns true if either operand is true; if both are false, returns false.
API Example
Pointful
var or = require('logical-or')
or(1, 0)
//=> 1
Pointfree Style
var or = require('logical-or')
var prices = ['$ 50.00', '', '$ 20.00']
prices.map(or('Price unknown'))
//=> ['$ 50.00', 'Price unknown', '$ 20.00']
API
or(expr2, expr1)
please note the argument order.
arguments
expr2 (mixed)
.expr1 (mixed)
.
returns
(mixed)
Returnsexpr1
if it can be converted to true; otherwise, returnsexpr2
.
Related
Contributing
SEE: contributing.md