Skip to main content
Module

x/ramda/source/cond.js

:ram: Practical functional Javascript
Latest
import * as ramda from "https://deno.land/x/ramda@v0.27.2/source/cond.js";

Variables

Returns a function, fn, which encapsulates if/else, if/else, ... logic. R.cond takes a list of [predicate, transformer] pairs. All of the arguments to fn are applied to each of the predicates in turn until one returns a "truthy" value, at which point fn returns the result of applying its arguments to the corresponding transformer. If none of the predicates matches, fn returns undefined.