---
title: "NodeListOf | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

# Interface NodeListOf<TNode>

**`NodeList`** objects are collections of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll().

[MDN Reference](https://developer.mozilla.org/docs/Web/API/NodeList)

interface NodeListOf<[TNode](#tnode) extends [Node](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Node/)\> {  
    [length](#length): number;  
    ["\[iterator\]"](#iterator-1)(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[TNode](#tnode)\>;  
    [entries](#entries-1)(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<\[number, [TNode](#tnode)\]\>;  
    [forEach](#foreach-1)(  
        callbackfn: (  
            value: [TNode](#tnode),  
            key: number,  
            parent: NodeListOf<[TNode](#tnode)\>,  
        ) \=> void,  
        thisArg?: any,  
    ): void;  
    [item](#item-1)(index: number): [TNode](#tnode);  
    [keys](#keys-1)(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<number\>;  
    [values](#values-1)(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[TNode](#tnode)\>;  
    \[index: number\]: [TNode](#tnode);  
}

#### Type Parameters

-   TNode extends [Node](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Node/)

#### Hierarchy ([View Summary](https://docs.maptiler.com/sdk-js/api-reference/hierarchy/#Externals.NodeListOf))

-   [NodeList](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/)
    -   NodeListOf
        -   [RadioNodeList](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.RadioNodeList/)

#### Indexable

-   \[index: number\]: [TNode](#tnode)
    

##### Index

### Properties[](#properties)

[length](#length)

### Methods[](#methods)

[\[iterator\]](#iterator) [entries](#entries) [forEach](#foreach) [item](#item) [keys](#keys) [values](#values)

## Properties[](#properties-1)

### `Readonly`length[](#length)

length: number

The **`NodeList.length`** property returns the number of items in a NodeList.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/NodeList/length)

Inherited from [NodeList](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/).[length](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/#length)

## Methods[](#methods-1)

### \[iterator\][](#iterator)

-   "\[iterator\]"(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[TNode](#tnode)\>[](#iterator-1)
    
    #### Returns [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[TNode](#tnode)\>
    
    Inherited from [NodeList](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/).[\[iterator\]](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/#iterator)
    

### entries[](#entries)

-   entries(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<\[number, [TNode](#tnode)\]\>[](#entries-1)
    
    Returns an array of key, value pairs for every entry in the list.
    
    #### Returns [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<\[number, [TNode](#tnode)\]\>
    
    Inherited from [NodeList](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/).[entries](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/#entries)
    

### forEach[](#foreach)

-   forEach(  
        callbackfn: (  
            value: [TNode](#tnode),  
            key: number,  
            parent: NodeListOf<[TNode](#tnode)\>,  
        ) \=> void,  
        thisArg?: any,  
    ): void[](#foreach-1)
    
    #### Parameters
    
    -   callbackfn: (value: [TNode](#tnode), key: number, parent: NodeListOf<[TNode](#tnode)\>) \=> void
    -   `Optional`thisArg: any
    
    #### Returns void
    
    Overrides [NodeList](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/).[forEach](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/#foreach)
    

### item[](#item)

-   item(index: number): [TNode](#tnode)[](#item-1)
    
    Returns a node from a NodeList by index. This method doesn't throw exceptions as long as you provide arguments. A value of null is returned if the index is out of range, and a TypeError is thrown if no argument is provided.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/NodeList/item)
    
    #### Parameters
    
    -   index: number
    
    #### Returns [TNode](#tnode)
    
    Overrides [NodeList](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/).[item](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/#item)
    

### keys[](#keys)

-   keys(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<number\>[](#keys-1)
    
    Returns an list of keys in the list.
    
    #### Returns [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<number\>
    
    Inherited from [NodeList](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/).[keys](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/#keys)
    

### values[](#values)

-   values(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[TNode](#tnode)\>[](#values-1)
    
    Returns an list of values in the list.
    
    #### Returns [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[TNode](#tnode)\>
    
    Inherited from [NodeList](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/).[values](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.NodeList/#values)
