0.1.4 • Published 9 years ago

logical-or v0.1.4

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

logical-or

Binary logical OR operator (||) as an auto-curried function.

Build Status Code Climate js-standard-style

npm install logical-or --save

You can also use Duo, Bower or download the files manually.

npm stats

npm NPM downloads David

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) Returns expr1 if it can be converted to true; otherwise, returns expr2.

Related

Contributing

SEE: contributing.md

Licenses

GitHub license

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago