Retsu is an Array library for Client or Server, focused on speed & providing useful functions.
Adds arg
to obj
if it is not found in obj
Performs a binary search on obj
(must be sorted) for arg
Returns an Object ( NodeList, etc. ) as an Array; if keys
is true you will get the keys of the Object
Transforms an Array to a 2D Array of chunks
Clears an Array without destroying it
Clones an Array, shallow
defaults to true
Compacts a Array by removing null
or undefined
indices; returns null
if diff
is true
and there is no difference
Counts the occurrence of arg
in obj
Finds the difference between two Arrays
Iterates obj
and executes fn
with arguments [value
, index
]; returning false
from fn
halts iteration
Determines if an Array is empty
Determines if two Arrays are equal
Fills obj
with the evalution of arg
, optionally from start
to offset
Flattens a 2D Array
Finds the intersections between two Arrays
Iterates an Array using an Iterator
Creates an Array generator to iterate the indices
Returns the last index of the Array, with an optional offset
from the end to retrieve a range
Returns a limited range of indices from the Array
Finds the maximum value in an Array
Finds the mean of an Array
Finds the median value of an Array
Merges obj2
into obj1
, excluding duplicate indices
Finds the minimum value in an Array
Mingles Arrays and returns a 2D Array, corresponding index positions are paired
Finds the mode value of an Array
Finds the range of the Array
Removes indices from an Array without recreating it
Replaces the contents of obj1
with obj2
Generates a series Array
Sorts the Array by parsing values, to be used with [].sort()
Sorts obj
using sort
Spreads an Array by divisor arg
, e.g. retsu.spread(new Array(100), 21)
Finds the standard deviation of an Array
Gets the summation of an Array
Returns an Array of unique indices of obj
Finds the variance of an Array
Copyright (c) 2017 Jason Mulligan Licensed under the BSD-3 license.