arrif
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

ArrIf

An alternative implementation of the if-else statement using arrays

Install

# npm 
npm install arrif
 
# yarn 
yarn add arrif

Usage

import arrif from 'arrif'
 
console.log(arrif("Si", "No", true))
//=> Si

API

arrif: (t, f, c) => any

t

Type: any Returned if condition is true

f

Type: any Returned if condition is false

c

Type: string | number | boolean | null | undefined Condition

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i arrif

    Weekly Downloads

    2

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    3.01 kB

    Total Files

    10

    Last publish

    Collaborators

    • imedadel