add

math

all-pass

logic

any-pass

logic

aperture

list

assoc

object

assoc-path

object

compose

function

concat

list

dec

math

dissoc

object

divide

math

eq-by

relation

equals

relation

F

function

filter

list

find

list

gt

relation

gte

relation

has

object

has-path

undefined

hasPath

object

head

list

identity

function

implode

list

inc

math

includes

list

init

list

inner-join

relation

intersection

relation

last

list

lt

relation

lte

relation

map

list

mean

math

median

math

merge

object

merge-all

list

merge-deep-left

object

merge-deep-right

object

merge-deep-with

object

merge-deep-with-key

object

merge-left

object

merge-right

object

merge-with

object

merge-with-key

object

multiply

math

negate

math

omit

object

partition

list

path

object

path-eq

relation

path-or

object

path-satisfies

logic

paths

object

pick

object

pipe

function

pluck

list

prepend

list

product

math

prop

object

prop-eq

relation

props

object

reduce

list

reject

list

slice

list

split

string

split-every

list

subtract

math

sum

math

T

function

tail

list

trim

string

uniq

list

without

list

math

View Source

Adds two values.

Parameters

Parameters

nametypedescription
aNumber
bNumber
$add-numbers: add(10, 20);
@debug $add-numbers; //=> 30

Takes a list of predicates and returns true for a list of arguments if every one of the provided predicates is satisfied by those arguments.

Parameters

Parameters

nametypedescription
predsListAn array of predicates to check
val*The value to check against
$is-odd-lt20-gt5: all-pass((odd, lt20, gt5), 7);
@debug $is-odd-lt20-ft5; //=> true

Takes a list of predicates and returns true for a given list of arguments if at least one of the provided predicates is satisfied by those arguments.

Parameters

Parameters

nametypedescription
predsListAn array of predicates to check
val*The value to check against
$is-odd-gt20-lt5: any-pass((odd, gt20, lt5), 7);
@debug $is-odd-gt20-lt5; //=> true

Returns a new list, composed of n-tuples of consecutive elements. If `n` is greater than the length of the list, an empty list is returned.

Parameters

Parameters

nametypedescription
nNumberThe size of the tuples to create
listArrayThe list to split into `n`-length tuples
$consecutive: aperture(2, (1, 2, 3, 4, 5);
@debug $consecutive; //=> (1 2) (2 3) (3 4) (4 5)

Makes a shallow clone of an object, setting or overriding the specified property with the given value.

Parameters

Parameters

nametypedescription
propStringThe property name to set
val*The new value
objObjectThe object to clone
See:
@dissoc
@pick
$obj: (
a: 1,
b: 2
);
$set-prop: assoc('c', 3, $obj);
@debug $set-prop; //=> ( a: 1, b: 2, c: 3)

Makes a shallow clone of an object, setting or overriding the nodes required to create the given path

Parameters

Parameters

nametypedescription
pathArraythe path to set
val*The new value
objObjectThe object to clone
$set-prop: assoc-path('a' 'b' 'c', 42, (a: (b: (c: 0))));
@debug $set-prop; //=> (a: (b: (c: 42)))

Performs right-to-left function composition. The right most parameter is the input

Parameters

Parameters

nametypedescription
params...Function...The functions and input to compose
See:
@pipe
$input: ('a', 'b', 'c');
$output: compose(
(implode, '-'),
(join, ('d', 'e')),
$input);
@debug $output; //=> 'd-e-a-b-c'

Returns the result of concatenating the given lists or strings.

Parameters

Parameters

nametypedescription
aArray|StringThe first list
bArray|StringThe second list
$concat-arrays: concat([1, 2, 3], [4, 5, 6]);
@debug $concat-arrays //=> [1, 2, 3, 4, 5, 6]
$concat-strings: concat('ABC', 'DEF');
@debug $concat-strings; //=> 'ABCDEF'

Deincrements its argument.

Parameters

Parameters

nametypedescription
nNumber
See:
@inc
$nineteen: dec(20);
@debug $nineteen; //=> 19

Returns a new object that does not contain a `prop` property.

Parameters

Parameters

nametypedescription
propStringThe name of the property to dissociate
objObjectThe object to clone
See:
@assoc
@pick
$obj: (a: 1, b: 2, c: 3);
$remove-prop: dissoc('b' $obj);
@debug $remove-prop; //=> (a: 1, c: 3)

Divides two values.

Parameters

Parameters

nametypedescription
aNumber
bNumber
$divide-numbers: divide(10, 2);
@debug $divide-numbers; //=> 5

Takes a function and two values in its domain and returns `true` if the values map to the same value in the codomain; `false` otherwise.

Parameters

Parameters

nametypedescription
fnFunction
x*
y*
$is-eq: eq-by(abs, 5, -5);
@debug $is-eq; //=> true

Returns `true` if its arguments are equivalent, `false` otherwise. Refer to https://sass-lang.com/documentation/operators/equality if in doubt.

Parameters

Parameters

nametypedescription
a*
b*
equals(1, 1); //=> true
equals(1, '1'); //=> false
equals([1, 2, 3], [1, 2, 3]); //=> true

function

A function that always returns `false`. Any passed in parameters are ignored.

$not-true: F();
@debug $not-true; //=> false

Takes a predicate and a `filterable`, and returns a new filterable of the same type containing the members of the given filterable which satisfy the given predicate.

Parameters

Parameters

nametypedescription
predFunction
filterableArray
See:
@reject
@function isEven($n) {
@return $n % 2 == 0;
}
$only-even-plz: filter(isEven, (1, 2, 3, 4));
@debug $only-even-plz; //=> (2 4)

Returns the first element of the list which matches the predicate, or `null` if no element matches.

Parameters

Parameters

nametypedescription
predFunctionThe predicate function used to determine if the element is the desired one.
listArrayThe array to consider.
See:
@reject
@function isEven($n) {
@return $n % 2 == 0;
}
$find-first-even: find(isEven, (1, 2, 3, 4));
@debug $find-first-even; //=> (2 4)

Returns `true` if the first argument is greater than the second; `false` otherwise.

Parameters

Parameters

nametypedescription
aNumber
bNumber
See:
@lt
gt(2, 1); //=> true
gt(2, 2); //=> false
gt(2, 3); //=> false

Returns `true` if the first argument is greater than or equal to the second; `false` otherwise.

Parameters

Parameters

nametypedescription
aNumber
bNumber
See:
@lte
gte(2, 1); //=> true
gte(2, 2); //=> true
gte(2, 3); //=> false

Returns whether or not an object has a property with the specified name

Parameters

Parameters

nametypedescription
propStringThe name of the property to check for.
objObjectThe object to query.
$alice: (name: 'alice');
$has-name: has('name', $alice);
$has-flower: has('flower', $alice);
@debug $has-name; //=> true
@debug $has-flower; //=> false

Returns whether or not a path exists in an object.

Parameters

Parameters

nametypedescription
pathArrayThe path to use.
objObjectThe object to check the path in.
$nested-obj: (a: (b: 2));
$has-path: hasPath(('a', 'b'), $nested-obj);
$no-has-path: hasPath(('a', 'c'), $nested-obj);
@debug $has-path; //=> true
@debug $no-has-path; //=> false

Returns the first element of the given list or string. In some libraries this function is named `first`.

Parameters

Parameters

nametypedescription
listArray|String
$first: head((1 2 3 4 5 6 7 8 9));
@debug $first; //=> 1
$first: head('hello world');
@debug $first; //=> 'h'

A function that does nothing but return the parameter supplied to it. Good as a default or placeholder function.

$is-one: identity(1);
@debug $is-one; //=> 1

Returns a string made by inserting the `separator` between each element and concatenating all the elements into a single string. Ramda defines this as join but sass has it's own join method.

Parameters

Parameters

nametypedescription
separatorNumber|StringThe string used to separate the elements.
xsArrayThe elements to join into a string.
$imploded: implode('|', (1 2 3 4 5 6 7 8 9));
@debug $imploded; //=> '1|2|3|4|5|6|7|8|9'

Increments its argument.

Parameters

Parameters

nametypedescription
nNumber
See:
@dec
$twenty: inc(19);
@debug $twenty; //=> 20

Returns `true` if the specified value is equal, in [`equals`](#equals) terms, to at least one element of the given list; `false` otherwise. Also works with strings.

Parameters

Parameters

nametypedescription
a*The item to compare against.
listArray|StringThe array to consider.
See:
@dec
$has-seventeen: includes(17, (1, 5, 6, 11, 17, 28));
@debug $has-seventeen; //=> true

Returns all but the last element of the given list or string.

Parameters

Parameters

nametypedescription
listList|String
See:
@last
@head
@tail
$first: init((1 2 3 4 5 6 7 8 9));
@debug $first; //=> (1 2 3 4 5 6 7 8)
$first: init('hello world');
@debug $first; //=> 'hello worl'

Takes a predicate and two lists and returns a list comprising each of the elements of `a` which is equal to one or more elements of `b` according to `pred`.

Parameters

Parameters

nametypedescription
predFunction
aArray
bArray
See:
@intersection
$buffalos: inner-join(
(record, id) => record.id === id,
[{id: 824, name: 'Richie Furay'},
{id: 956, name: 'Dewey Martin'},
{id: 313, name: 'Bruce Palmer'},
{id: 456, name: 'Stephen Stills'},
{id: 177, name: 'Neil Young'}],
[177, 456, 999]
);
@debug $buffalos; //=> [{id: 456, name: 'Stephen Stills'}, {id: 177, name: 'Neil Young'}]

Combines two lists into a set (i.e. no duplicates) composed of those elements common to both lists.

Parameters

Parameters

nametypedescription
list1ArrayThe first list.
list2ArrayThe second list.
See:
@inner-join
$four-n-three: intersection([1,2,3,4], [7,6,5,4,3]);
@debug $four-n-three; //=> [4, 3]

Returns the last element of the given list or string.

Parameters

Parameters

nametypedescription
listList|String
See:
@init
@head
@tail
$last: last((1 2 3 4 5 6 7 8 9));
@debug $last; //=> 9
$last: last('hello world');
@debug $last; //=> 'd'

Returns `true` if the first argument is less than the second; `false` otherwise.

Parameters

Parameters

nametypedescription
aNumber
bNumber
See:
@gt
lt(2, 1); //=> false
lt(2, 2); //=> false
lt(2, 3); //=> true

Returns `true` if the first argument is less than or equal to the second; `false` otherwise.

Parameters

Parameters

nametypedescription
aNumber
bNumber
See:
@gte
lte(2, 1); //=> false
lte(2, 2); //=> true
lte(2, 3); //=> true

Takes a function and applies the function to each of the functor's values. sass-fire provides suitable map implementations for List and Map.

Parameters

Parameters

nametypedescription
fnFunctionThe function to be called on every element of the input `list`.
listArray | ObjectThe list to be iterated over.
@function double($number) { @return $number * 2; }
$double-list: map(double, [1 2 3 4 5 6 7 8 9]);
@debug $double-list; //=> [2 4 6 8 10 12 14 16 18]
$double-obj: map(double, (x: 1, y: 2, z: 3));
@debug $double-obj; //=> (x: 2, y: 4, z: 6)

Returns the mean average of the given list of numbers.

Parameters

Parameters

nametypedescription
listList
$mean-average: mean(2, 7, 9);
@debug $mean-average; //=> 6

Returns the median average of the given list of numbers.

Parameters

Parameters

nametypedescription
listList
$median-average: median(12, 5, 17, 1, 7);
@debug $median-average; //=> 7

Creates a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects, the value from the second object will be used.

Parameters

Parameters

nametypedescription
lObjectleft object
rObjectright object
See:
@merge-right
@merge-deep-right
@merge-with
@merge-with-key
$merge-objs: merge(concat,
( 'name': 'fred', 'age': 10 )
( 'age': 40 )
);
@debug $merge-objs; //=> ( 'name': 'fred', 'age': 40 )

Merges a list of objects together into one object.

Parameters

Parameters

nametypedescription
listListarray of objects
See:
@reduce
$merge-objs: merge-all((foo: 1), (bar: 2), (baz: 3));
@debug $merge-objs; //=> (foo: 1, bar: 2, baz: 3)
$override-props: merge-all((foo: 1), (foo: 2), (bar: 2));
@debug $override-props; //=> (foo: 2, bar: 2)

Creates a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects: - and both values are objects, the two values will be recursively merged - otherwise the value from the first object will be used.

Parameters

Parameters

nametypedescription
l-objObjectleft object
r-objObjectright object
See:
@merge
@merge-deep-right
@merge-deep-with
@merge-deep-with-key
$merge-objs: merge-deep-left(
( name: 'fred', age: 10, contact: ( email: 'moo@example.com' )),
( age: 40, contact: ( email: 'baa@example.com' ))
);
@debug $merge-objs; //=> ( name: 'fred', age: 10, contact: ( email: 'moo@example.com' ))

Creates a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects: - and both values are objects, the two values will be recursively merged - otherwise the value from the second object will be used.

Parameters

Parameters

nametypedescription
l-objObjectleft object
r-objObjectright object
See:
@merge
@merge-deep-left
@merge-deep-with
@merge-deep-with-key
$merge-objs: merge-deep-right(
( name: 'fred', age: 10, contact: ( email: 'moo@example.com' )),
( age: 40, contact: ( email: 'baa@example.com' ))
);
@debug $merge-objs; //=> ( name: 'fred', age: 40, contact: ( email: 'baa@example.com' ))

Creates a new object with the own properties of the two provided objects. If a key exists in both objects: - and both associated values are also objects then the values will be recursively merged. - otherwise the provided function is applied to associated values using the resulting value as the new value associated with the key. If a key only exists in one object, the value will be associated with the key of the resulting object.

Parameters

Parameters

nametypedescription
fnFunctionfunction to call when two keys match
l-objObjectleft object
r-objObjectright object
See:
@merge-deep-with-key
@merge-with
$merge-objs: merge-deep-with(concat,
( a: true, c: ( thing: 'foo', values: [10, 20] ))
( b: true, c: ( thing: 'bar', values: [15, 35] ))
);
@debug $merge-objs; //=> ( a: true, b: true, c: ( thing: 'bar', values: [10, 20, 15, 35] ))

Creates a new object with the own properties of the two provided objects. If a key exists in both objects: - and both associated values are also objects then the values will be recursively merged. - otherwise the provided function is applied to the key and associated values using the resulting value as the new value associated with the key. If a key only exists in one object, the value will be associated with the key of the resulting object.

Parameters

Parameters

nametypedescription
fnFunctionfunction to call when two keys match
l-objObjectleft object
r-objObjectright object
See:
@merge-with-key
@merge-deep-with
@function concat-values($k, $l, $r) { @return if($k == 'values', concat($l, $r), $r);
$merge-objs: merge-deep-with-key(concatValues,
( a: true, c: ( thing: 'foo', values: [10, 20] ))
( b: true, c: ( thing: 'bar', values: [15, 35] ))
);
@debug $merge-objs; //=> ( a: true, b: true, c: ( thing: 'bar', values: [10, 20, 15, 35] ))

Create a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects, the value from the first object will be used.

Parameters

Parameters

nametypedescription
lObjectleft object
rObjectright object
See:
@merge-right
@merge-deep-right
@merge-with
@merge-with-key
$merge-objs: merge-left((x: 0), (x: 5, y: 2));
@debug $merge-objs; //=> (x: 0, y: 2);

Create a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects, the value from the second object will be used.

Parameters

Parameters

nametypedescription
lObjectleft object
rObjectright object
See:
@merge-left
@merge-deep-right
@merge-with
@merge-with-key
$merge-objs: merge-right((x: 0), (x: 5, y: 2));
@debug $merge-objs; //=> (x: 5, y: 2);

Creates a new object with the own properties of the two provided objects. If a key exists in both objects, the provided function is applied to the values associated with the key in each object, with the result being used as the value associated with the key in the returned object.

Parameters

Parameters

nametypedescription
fnFunctionfunction to call when two keys match
lObjectleft object
rObjectright object
See:
@merge-deep-with-key
@merge
@merge-with-key
$merge-objs: merge-with(concat,
( a: true, values: [10, 20] )
( b: true, values: [15, 35] )
);
@debug $merge-objs; //=> ( a: true, b: true, values: [10, 20, 15, 35] )

Creates a new object with the own properties of the two provided objects. If a key exists in both objects, the provided function is applied to the key and the values associated with the key in each object, with the result being used as the value associated with the key in the returned object.

Parameters

Parameters

nametypedescription
fnFunctionfunction to call when two keys match
lObjectleft object
rObjectright object
See:
@merge-deep-with-key
@merge
@merge-with
@function concat-values($k, $l, $r) { @return if($k == 'values', concat($l, $r), $r);
$merge-objs: merge-with-key(concat-values,
( 'a': true, 'thing': 'foo', 'values': [10 20] )
( 'b': true, 'thing': 'bar', 'values': [15 25] )
);
@debug $merge-objs; //=> ( a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] )

Multiplies two values.

Parameters

Parameters

nametypedescription
aNumber
bNumber
$multiply-numbers: multiply(10, 2);
@debug $multiply-numbers; //=> 20

Negates its argument.

Parameters

Parameters

nametypedescription
nNumber
$negate-numbers: negate(40);
@debug $negate-numbers; //=> -40

Returns a partial copy of an object omitting the specified keys

Parameters

Parameters

nametypedescription
keysListkeys to remove from the map
mapMapthe map to copy from
$map-omit: omit((tom, harry), (tom: 1, dick: 2, harry: 3));
@debug $map-omit; //=> (dick: 2)

Takes a predicate and a list and returns a pair of filterable lists of the same type of elements which do and do not satisfy, the predicate, respectively.

Parameters

Parameters

nametypedescription
predFunctionA predicate to determine which side the element belongs to.
filterableArraythe list to partition.
See:
@filter
@reject
@function is-even($n) { @return $n % 2 == 0; }
$even-n-odd: partition(is-even, (1, 2, 3, 4));
@debug $even-n-odd; //=> ((2 4), (1 3))

Retrieves the value at a given path of an object

Parameters

Parameters

nametypedescription
pathListThe path to use.
mapObjectThe map to retrieve the nested property from.
$get-value: path(('a', 'b'), (a: (b: 2)));
@debug $get-value; //=> 2

Determines whether a nested path on an object has a specific value. Most likely used to filter a list.

Parameters

Parameters

nametypedescription
pathListThe path to use.
value*The value to compare.
mapObjectThe map to retrieve the nested property from.
$is-42: path-eq(('x', 'y'), 42, (x: (y: 42)));
@debug $is-42; //=> true

If the given, non-null object has a value at the given path, returns the value at that path. Otherwise returns the provided default value.

Parameters

Parameters

nametypedescription
d*The default value.
pathListThe path to use.
mapObjectThe map to retrieve the nested property from.
$get-default: path-or('N/A', ('x', 'y'), (a: (b: 2)));
@debug $get-value; //=> "N/A"

Returns `true` if the specified object property at given path satisfies the given predicate; `false` otherwise.

Parameters

Parameters

nametypedescription
predFunction
pathListThe path to use.
mapObjectThe map to retrieve the nested property from.
@function is-positive($n) { @return $n > 0; }
$value-is-pos: path-satisfies(is-positive, ('a', 'b'), (a: (b: 2)));
@debug $value-is-pos; //=> true

Retrieves the values at a given path of an object

Parameters

Parameters

nametypedescription
paths-arrayListThe array of paths to be fetched.
mapObjectThe map to retrieve the nested properties from.
$get-values: paths(('a', 'b'), ('p', 0, 'q'), (a: (b: 2), p: ((q: 3))));
@debug $get-values; //=> (2, 3)

Returns a partial copy of an object containing only the keys specified. If the key does not exist, the property is ignored.

Parameters

Parameters

nametypedescription
namesArrayan array of String property names to copy onto a new object
objObjectThe object to copy from
See:
@omit
@props
$picky: pick(a d, ( a: 1, b: 2, c: 3, d: 4 ));
@debug $picky; //=> (a: 1, d: 4)

Performs left-to-right function composition.

Parameters

Parameters

nametypedescription
params...Function...The functions to compose
See:
@compose
$input: ('a', 'b', 'c');
$output: pipe(
(join, ('d', 'e')),
(implode, '-'),
$input);
@debug $output; //=> 'd-e-a-b-c'

Returns a new list by plucking the same named property from all objects in the supplied list.

Parameters

Parameters

nametypedescription
keyNumber|StringThe key name to pluck from each object.
arrArrayThe array to consider.
See:
@props
$avenger-names: pluck('name', $avengers)
@debug $avenger-names; //=> ('Black Widow' 'Captain America' 'Hawkeye' 'Hulk' 'Iron man' 'Thor')

Returns a new list with the given element at the front, followed by the contents of the list.

Parameters

Parameters

nametypedescription
el*The item to add to the head of the output list.
listArrayThe array to add to the tail of the output list.
R.prepend('fee', ('fi', 'fo', 'fum')); //=> ('fee', 'fi', 'fo', 'fum')

Multiplies together all the elements of a list.

Parameters

Parameters

nametypedescription
listArrayAn array of numbers
$multipy-list: product(2, 4, 6, 8, 100, 2);
@debug $multipy-list; //=> 76800

returns the indicated property of that object, if it exists.

Parameters

Parameters

nametypedescription
pString|NumberThe property name or array index
mapList|ObjectThe map to query
$get-prop: prop('a', (a: 2));
@debug $get-prop; //=> 2

Returns `true` if the specified object property is equal to the given value; `false` otherwise.

Parameters

Parameters

nametypedescription
nameString
val*
map*
@function has-brown-hair($item) { @return prop-eq('hair', 'brown', $item); }
$brown-haired-avengers: filter(has-brown-hair, $avengers);
@debug $brown-haired-avengers; //=> ('Iron Man', 'Hawkeye', 'Black Widow')

Acts as multiple `prop`: array of keys in, array of values out.

Parameters

Parameters

nametypedescription
namesArrayThe property names to fetch
objObjectThe object to query
$list-of-values-plz: props(a d, ( a: 1, b: 2, c: 3, d: 4 ));
@debug $list-of-values-plz; //=> (1, 4)

Returns a single item by iterating through the list, successively calling the iterator function and passing it an accumulator value and the current value from the array, and then passing the result to the next call.

Parameters

Parameters

nametypedescription
fnFunctionThe iterator function. Receives two values, the accumulator and the current element from the array.
acc*The accumulator value.
listArrayThe list to iterate over.
$sum-of-numbers-plz: reduce(add, 0, (1 2 3 4 5 6 7 8 9));
@debug $sum-of-numbers-plz; //=> 45

The complement of `filter`

Parameters

Parameters

nametypedescription
predFunction
filterableArray
See:
@filter
@function isEven($n) {
@return $n % 2 == 0;
}
$only-odd-plz: reject(isEven, (1, 2, 3, 4));
@debug $only-odd-plz; //=> (1 3)

Returns the elements of the given list or string from `fromIndex` to `toIndex`.

Parameters

Parameters

nametypedescription
fromIndexNumberThe start index.
toIndexNumberThe end index.
list*
$sliced: slice(5, 9, (1 2 3 4 5 6 7 8 9));
@debug $sliced; //=> (5 6 7 8 9)
$sliced: slice(1, 4, 'hello world');
@debug $sliced; //=> 'hell'

Splits a string into an array of strings based on the given separator.

Parameters

Parameters

nametypedescription
sepStringThe pattern.
strStringThe string to separate into an array.
See:
@implode
$splitted: split('-', 'a-b-c-d-e-f-g');
@debug $splitted; //=> ('a', 'b', 'c', 'd', 'e', 'f', 'g')

Splits a collection into slices of the specified length.

Parameters

Parameters

nametypedescription
nNumber
listArray
See:
@implode
$splitted: split-every(2, (1, 2, 3, 4));
@debug $splitted; //=> (1 2) (3 4);

Subtract two values.

Parameters

Parameters

nametypedescription
aNumber
bNumber
$subtract-numbers: subtract(10, 20);
@debug $subtract-numbers; //=> 10

Adds a list of numbers together.

Parameters

Parameters

nametypedescription
listList
$add-list: sum(10, 20, 30, 40, 50, 60, 70, 80, 90)
@debug $add-list; //=> 450

function

A function that always returns `true`. Any passed in parameters are ignored.

$so-true: T();
@debug $so-true; //=> true

Returns all but the first element of the given list or string.

Parameters

Parameters

nametypedescription
list*
See:
@head
@init
@last
$without-first: tail((1 2 3 4 5 6 7 8 9));
@debug $without-first; //=> (2 3 4 5 6 7 8 9)
$without-first: tail('hello world');
@debug $without-first; //=> 'ello world'

Removes (strips) whitespace from both ends of the string.

Parameters

Parameters

nametypedescription
strStringThe string to trim.
$trimmed: trim(' the donkey jumped over the lazy snake ');
@debug $trimmed; //=> 'thedonkeyjumpedoverthelazysnake'

Returns a new list containing only one copy of each element in the original list.

Parameters

Parameters

nametypedescription
listArrayThe array to consider.
uniq([1, 1, 2, 1]); //=> [1, 2]
uniq([1, '1']); //=> [1, '1']
uniq([[42], [42]]); //=> [[42]]

Returns a new list without values in the first argument. `equals` is used to determine equality.

Parameters

Parameters

nametypedescription
list1ArrayThe values to be removed from `list2`.
list2ArrayThe array to remove values from.
$without-one-two: without([1, 2], [1, 2, 1, 4, 5]);
@debug $without-one-two; //=> [4, 5]

Last built with ❤️ and 🔥 on: 31/03/2021