Module

x/rambda/index.d.ts>defaultTo

Faster and smaller alternative to Ramda
Latest
function defaultTo
import { defaultTo } from "https://dotland.deno.dev/x/rambda@9.4.1/index.d.ts";

It returns defaultValue, if all of inputArguments are undefined, null or NaN.

Else, it returns the first truthy inputArguments instance(from left to right).

Parameters

defaultValue: T
input: T | null | undefined

Parameters

defaultValue: T

Returns

(input: T | null | undefined) => T