Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/arrays/mod.ts>Arrays

Provides utility methods for common Array operations
Latest
namespace Arrays
import { Arrays } from "https://deno.land/x/arrays@v1.0.21/mod.ts";

Extends Array.Prototype with the below functions.

Functions

Returns an array split into chunks. If the array can't be split equally based on the given size, the last chunk will be the remaining elements.

Returns the common values from all the given arrays.

Returns an array with all falsey values (false, null, 0, '', undefined, and NaN) removed.

Checks if all the elements in the source array are present in the other arrays (args).

Returns the unique elements in an array compared to the rest of the arrays (args).

Flattens an arrays of arrays into a single array.

Flattens an array and checks if all the elements are of the specified type.

Merge the elements from the rest of the arrays (args) to the first array. A nested array will be considered as a single value.

Returns an array without the values passed as args.

Converts the nested arrays of an array into a single object of key-value pairs.

Returns the unique values from a given array. Optionally pass in a boolean to specify if the result should be sorted.