Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rambda/mod.ts>defaultTo

Faster and smaller alternative to Ramda
Latest
function defaultTo
import { defaultTo } from "https://deno.land/x/rambda@9.3.0/mod.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