Skip to content

bendrucker/ternary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ternary Build Status

Build a ternary statement

Install

$ npm install --save ternary

Usage

var ternary = require('ternary')

ternary('condition', 'whenTruthy', 'whenFalsy')
//=> condition ? whenTruthy : whenFalsy

API

ternary(condition, expr1, expr2) -> string

condition

Required
Type: string

The ternary condition.

expr1

Required
Type: string

The expression to use when the condition is truthy.

expr2

Required
Type: string

The expression to use when the condition is falsy.

License

MIT © Ben Drucker

About

Build a ternary statement

Resources

License

Stars

Watchers

Forks

Packages

No packages published