a list, item and an index
list with added item
Inserts the same item at multiple specified positions in the list. Example: In [10, 20, 30], adding 99 at indexes [0, 2] gives [99, 10, 20, 99, 30]
a list, item and an indexes
list with added item
Inserts multiple items at corresponding positions (first item at first index, second item at second index, etc.). Example: In [10, 20, 30], adding items [88, 99] at indexes [1, 2] gives [10, 88, 20, 99, 30]
a list, items and an indexes
list with added items
Appends an item to the end of the list. Example: To [10, 20, 30], adding 40 gives [10, 20, 30, 40]
a list and an item
list with added item
Adds an item to the beginning of the list. Example: To [10, 20, 30], prepending 5 gives [5, 10, 20, 30]
a list and an item
list with added item
Adds an item either at the beginning or end of the list based on the position parameter. Example: To [10, 20, 30], adding 5 at 'first' gives [5, 10, 20, 30], at 'last' gives [10, 20, 30, 5]
a list, item and an option for first or last position
list with added item
Combines multiple lists into a single list by joining them end-to-end. Example: From [[1, 2], [3, 4], [5, 6]], returns [1, 2, 3, 4, 5, 6]
lists to concatenate
concatenated list
Creates a new list by repeating an item a specified number of times. Example: Repeating 5 three times returns [5, 5, 5]
an item to multiply
list
Repeats a pattern of items cyclically until reaching a target list length. Example: Pattern [1, 2, 3] with length 7 returns [1, 2, 3, 1, 2, 3, 1]
a list to multiply and a length limit
list
Reverses the order of items in the list. Example: From [1, 2, 3, 4, 5], returns [5, 4, 3, 2, 1]
a list and an index
item
Randomly rearranges all items in the list (using Fisher-Yates algorithm). Example: From [1, 2, 3, 4, 5], might return [3, 1, 5, 2, 4] (order varies each time)
a list
shuffled list
Transposes a 2D list by swapping rows and columns (all sublists must be equal length). Example: From [[0, 1, 2], [3, 4, 5]], returns [[0, 3], [1, 4], [2, 5]]
a list of lists to flip
item
Splits the list into smaller lists of n elements each. Example: From [0, 1, 2, 3, 4, 5, 6, 7, 8] with n=3, returns [[0, 1, 2], [3, 4, 5], [6, 7, 8]] Example: From [0, 1, 2, 3, 4] with n=2 and keepRemainder=true, returns [[0, 1], [2, 3], [4]]
a list
items grouped in lists of n elements
Gets an item from the list at a specific position using zero-based indexing. Example: From [10, 20, 30, 40], getting index 2 returns 30
a list and an index
item
Gets the first item from the list. Example: From [10, 20, 30, 40], returns 10
a list
first item
Gets the last item from the list. Example: From [10, 20, 30, 40], returns 40
a list
last item
Randomly keeps items from the list based on a probability threshold (0 to 1). Example: From [1, 2, 3, 4, 5] with threshold 0.5, might return [1, 3, 5] (50% chance for each item)
a list and a threshold for randomization of items to remove
list with remaining items
Extracts a portion of the list between start and end positions (end is exclusive). Example: From [10, 20, 30, 40, 50] with start=1 and end=4, returns [20, 30, 40]
a list and start and end indexes
sub list
Gets every nth item from the list, starting from an optional offset position. Example: From [0, 1, 2, 3, 4, 5, 6, 7, 8] with nth=3 and offset=0, returns [0, 3, 6] Example: From [0, 1, 2, 3, 4, 5, 6, 7, 8] with nth=2 and offset=1, returns [1, 3, 5, 7]
a list and index
list with filtered items
Filters items from the list using a repeating true/false pattern. Example: From [0, 1, 2, 3, 4, 5] with pattern [true, true, false], returns [0, 1, 3, 4] (keeps items where pattern is true)
a list and index
list with filtered items
Merges elements from multiple lists at a specific nesting level, grouping elements by position. Example: From [[0, 1, 2], [3, 4, 5]] at level 0, returns [[0, 3], [1, 4], [2, 5]]
lists, level and flatten data
list with merged lists and flattened lists
Finds the length of the longest list among multiple lists. Example: From [[1, 2], [3, 4, 5, 6], [7]], returns 4 (length of [3, 4, 5, 6])
a list of lists
number of max length
Checks whether the list contains a specific item. Example: List [10, 20, 30, 40] with item 30 returns true, with item 50 returns false
a list and an item
true if item is in list
Finds the position (index) of the first occurrence of an item in the list. Example: In [10, 20, 30, 20, 40], finding 20 returns 1 (first occurrence), finding 50 returns -1 (not found)
a list and an item
index of the item or -1 if not found
Determines the maximum nesting level (depth) of a list structure. Example: [1, 2, 3] has depth 1, [[1, 2], [3, 4]] has depth 2, [[[1]]] has depth 3
a list
number of depth
Returns the number of items in the list. Example: [10, 20, 30, 40, 50] returns 5, [] returns 0
a length list
a number
Removes the item at a specific position in the list. Example: From [10, 20, 30, 40, 50], removing index 2 gives [10, 20, 40, 50]
a list and index
list with removed item
Removes the first item from the list. Example: From [10, 20, 30, 40], returns [20, 30, 40]
a list
list with first item removed
Removes the last item from the list. Example: From [10, 20, 30, 40], returns [10, 20, 30]
a list
list with last item removed
Removes an item counting from the end of the list (index 0 = last item, 1 = second-to-last, etc.). Example: From [10, 20, 30, 40, 50], removing index 1 from end gives [10, 20, 30, 50] (removes 40)
a list and index from end
list with removed item
Removes items at multiple specified positions from the list. Example: From [10, 20, 30, 40, 50], removing indexes [1, 3] gives [10, 30, 50]
a list and indexes
list with removed items
Removes every nth item from the list, starting from an optional offset position. Example: From [0, 1, 2, 3, 4, 5, 6, 7, 8] with nth=3 and offset=0, returns [1, 2, 4, 5, 7, 8] (removes 0, 3, 6)
a list and index
list with removed item
Randomly removes items from the list based on a probability threshold (0 to 1). Example: From [1, 2, 3, 4, 5] with threshold 0.5, might return [2, 4] (50% chance to remove each item)
a list and a threshold for randomization of items to remove
list with removed items
Removes duplicate numbers from the list, keeping only the first occurrence of each value. Example: From [1, 2, 3, 2, 4, 3, 5], returns [1, 2, 3, 4, 5]
a list of numbers
list with unique numbers
Removes duplicate numbers that are within a specified tolerance range of each other. Example: From [1.0, 1.001, 2.0, 2.002, 3.0] with tolerance 0.01, returns [1.0, 2.0, 3.0]
a list of numbers and the tolerance
list with unique numbers
Removes duplicate items from the list using strict equality comparison (works with any type). Example: From ['a', 'b', 'c', 'a', 'd', 'b'], returns ['a', 'b', 'c', 'd']
a list
list with unique items
Sorts numbers in ascending (lowest to highest) or descending (highest to lowest) order. Example: [5, 2, 8, 1, 9] ascending returns [1, 2, 5, 8, 9], descending returns [9, 8, 5, 2, 1]
a list of numbers to sort and an option for ascending or descending order
list
Sorts text strings alphabetically in ascending (A to Z) or descending (Z to A) order. Example: ['dog', 'apple', 'cat', 'banana'] ascending returns ['apple', 'banana', 'cat', 'dog']
a list of texts to sort and an option for ascending or descending order
list
Sorts objects by comparing numeric values of a specified property. Example: [{age: 30}, {age: 20}, {age: 25}] sorted by 'age' ascending returns [{age: 20}, {age: 25}, {age: 30}]
a list to sort, a property to sort by and an option for ascending or descending order
list
Combines multiple lists by alternating elements from each list (first from list1, first from list2, second from list1, etc.). Example: From [[0, 1, 2], [3, 4, 5]], returns [0, 3, 1, 4, 2, 5]
Lists to interleave
Flattened interleaved list
Inserts an item at a specific position in the list. Example: In [10, 20, 30, 40], adding 99 at index 2 gives [10, 20, 99, 30, 40]