Skip to main content
Module

x/fae/mod.ts>defaultTo

A functional module for Deno inspired from Ramda.
Latest
variable defaultTo
import { defaultTo } from "https://deno.land/x/fae@v1.1.1/mod.ts";

Returns the second argument if it is not null, undefined or NaN; otherwise the first argument is returned.

 const defaultTo125 = Fae.defaultTo(125)

 defaultTo125(null)  //=> 125
 defaultTo125(undefined)  //=> 125
 defaultTo125(false)  //=> false
 defaultTo125('Fae')  //=> 'Fae'

type

DefaultTo