Exported as arr
from `./array/index'
Returns the average of the sum of all items in a numerical array.
Beware of JavaScript's Automatic Type Conversion if your Array
contains something else than Numbers
.
Returns a new array without empty strings
, NaN
, null
, undefined
items.
- Returns a new array without
empty strings
,NaN
,null
,undefined
, false and 0 items.
Returns the numerical item closest to the given number.
Returns a new array which contains every even item of the original array.
Returns the highest coerced numerical numerical item of the array.
Returns the index of the first occurrence of the highest numerical item of the array.
Returns the index of the first occurrence of the lowest numerical item of the array.
Returns a boolean false if the array is not empty or a boolean true if the array is empty.
Returns the longest string entry of the array.
Returns the lowest numerical item of the array.
Returns a new Array which contains all the values of the two Arrays. Ensures that the new array contains only unique values.
Returns a new Array which contains all items of the two Arrays.
Returns a new array which contains every n-th item of the original array.
Returns a new array with shuffled items.
Be aware, that the shuffled items are not truly random because Math.random
will return a pseudo-random number.
Returns a new Array sorted by ascending order (Numbers).
Beware of JavaScripts Automatic Type Conversion if your Array
contains something else than Numbers
.
Returns a new Array sorted by descending order (Numbers).
Beware of JavaScripts Automatic Type Conversion if your Array
contains something else than Numbers
.
Returns the sum of all items in a numerical array.
Beware of JavaScript's Automatic Type Conversion if your Array
contains something else than Numbers
.
Returns a new array which contains every odd (second) item of the original array.
Returns an object where the keys are the array entries and the values the number of their occurrences.
Returns a copy of the array. Removes duplicate entries, keep in mind that it works only for entries with primitive values (string, number, bigint, boolean, undefined, symbol, and null). Preserves the order of the entries.
Creates a shallow-copied clone of the provided array. Since it's a shallow copy, nested objects or arrays will be copied by reference, not duplicated.
Returns the shortest string entry of the array.
Returns the length of the longest string entry of an Array of strings.
Returns an new array where the first entry is the "first" and the second entry is the "second" half or the original array.
Licensed under the MIT license. MIT - http://www.opensource.org/licenses/mit-license.php