package
Build a ternary statement
npm install ternaryGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Build a ternary statement
$ npm install --save ternaryvar ternary = require('ternary')
ternary('condition', 'whenTruthy' : 'whenFalsy')
//=> condition ? whenTruthy : whenFalsyternary(condition, expr1, expr2) -> stringRequired
Type: string
The ternary condition.
Required
Type: string
The expression to use when the condition is truthy.
Required
Type: string
The expression to use when the condition is falsy.
MIT © Ben Drucker