> For the complete documentation index, see [llms.txt](https://docs.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.angular-package.dev/sass/list/list.type.md).

# list.type()

The `list.type()` or `list.nth-type()` function returns the type of all or selected [`$n`](#usdn) indexes of [`$list`](#usdlist).

{% code lineNumbers="true" %}

```scss
// Functions.
@use 'get/get.map.function';
@use 'remove/remove.map.function';

// The `list.type()` function.
@function type($list, $n...) {
  $result: if(list.length($n) > 0, $n, $list);
  @for $i from 1 through list.length($result) {
    $result: list.set-nth(
      $result,
      $i,
      meta.type-of(
        list.nth($list, if(list.length($n) > 0, list.nth($result, $i), $i))
      )
    );
  }
  @return if(list.length($result) > 0, $result, null);
}
```

{% endcode %}

{% embed url="<https://github.com/angular-package/sass/blob/main/list/_list.type.function.scss>" %}

### Parameters

#### **`$list`**

The list to check type of all or given [`$n`](#usdn).

#### `$n...`

Indexes of number type to check their types in [`$list`](#usdlist).

### Return

The list with the types of the given [`$n`](#usdn) indexes.

## Examples

### All types

```scss
// Use.
@use 'angular-package/sass/list';
$-list: ('a', 2, (a: 231), 'b', 7, null, 'c', 5, 'd', 231);

// Examples.
@debug list.type($-list); // string, number, map, bool, string, number, null, string, number, string, number

```

### Selected

```scss
// Examples.
@debug list.type($-list, 4, 1, 3, 6); // string, string, map, null
@debug list.type($-list, 4, 1, 3, 6, 9); // string, string, map, null, string

```

### Not in range

```scss
// Examples.
@debug list.type($-list, 4, 1, 3, 6, 11); // ! Error not in range

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.angular-package.dev/sass/list/list.type.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
