Functions
Last updated
Last updated
These are the available library functions.
A function that takes a single parameter and returns it. Essentially a no-op for mapping.
Given several methods which can return a boolean, create a new predicate which logically "ors" them together.
Given several methods which can return a boolean, create a new predicate which logically "ands" them together.
Given a function that takes multiple parameters, create a new function which takes those parameters as a single tuple instead.
Exactly like Array.prototype.map
, but functional instead of on the Array prototype.
Given a value and a function, run the function on the value. This is like map
, but for working on any data type. Useful in pipe
d series of computations.
Given a value, return a function that will return that value every time it is called.
Basically a functional switch statement. Run several predicates to find the correct code path, then transform the data as requested.
Given a value, create a new function which will take a second value and compare their equality. Uses Javascript's ===
operator.
Given an array, return the first value or undefined
.
Given an array, return the nth value or undefined
. nth
is 1-indexed.
Given an array, return the index value or undefined
. index
is 0-indexed.
Given an array, return the last value or undefined
.
Given an array, return every item except the first.
Create a predicate which checks whether a value is greater than a number.
Create a predicate which checks whether a value is greater than or equal a number.
Create a predicate which checks whether a value is less than a number.
Create a predicate which checks whether a value is less than or equal a number.
Create a predicate which checks whether a value is between two values.
Create a function which grabs a key from an object.
Create a function which removes a key from an object.
Create a function runs a series of functions in order, passing the result of each step to the next in the series.