Module

x/rambda/index.d.ts>defaultTo

Faster and smaller alternative to Ramda
Go to Latest
function defaultTo
import { defaultTo } from "https://dotland.deno.dev/x/rambda@v9.2.0/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