Skip to main content

remove-nth ()

Returns a list without the value at a specified index.

Parameters

$list
The list to which the value is to be removed.
Type
List
$index
The index at which the value is to be removed. A negative index can be used, indicating an offset from the end of the list.
Type
Number
$separator
The type of separator to be used by the copied list.
Type
space | comma | slash | auto
Default
auto

Return Value

List
A list without the value at the given index.

Example

@use '@sass-fairy/list';

$list: 'ant', 'bison', 'camel', 'bison', 'duck', 'elephant';

@debug list.remove-nth($list, 3);
// 'ant', 'bison', 'bison', 'duck', 'elephant'