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

# Interface SVGNumberList

The **`SVGNumberList`** interface defines a list of numbers.

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

interface SVGNumberList {  
    [length](#length): number;  
    [numberOfItems](#numberofitems): number;  
    ["\[iterator\]"](#iterator-1)(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)\>;  
    [appendItem](#appenditem-1)(newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/);  
    [clear](#clear-1)(): void;  
    [getItem](#getitem-1)(index: number): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/);  
    [initialize](#initialize-1)(newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/);  
    [insertItemBefore](#insertitembefore-1)(newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/), index: number): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/);  
    [removeItem](#removeitem-1)(index: number): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/);  
    [replaceItem](#replaceitem-1)(newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/), index: number): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/);  
    \[index: number\]: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/);  
}

#### Indexable

-   \[index: number\]: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)
    

##### Index

### Properties[](#properties)

[length](#length) [numberOfItems](#numberofitems)

### Methods[](#methods)

[\[iterator\]](#iterator) [appendItem](#appenditem) [clear](#clear) [getItem](#getitem) [initialize](#initialize) [insertItemBefore](#insertitembefore) [removeItem](#removeitem) [replaceItem](#replaceitem)

## Properties[](#properties-1)

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

length: number

The **`length`** property of the SVGNumberList interface returns the number of items in the list. It is an alias of numberOfItems to make SVG lists more array-like.

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

### `Readonly`numberOfItems[](#numberofitems)

numberOfItems: number

The **`numberOfItems`** property of the SVGNumberList interface returns the number of items in the list. length is an alias of it.

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

## Methods[](#methods-1)

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

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

### appendItem[](#appenditem)

-   appendItem(newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)[](#appenditem-1)
    
    The **`appendItem()`** method of the SVGNumberList interface inserts a new item at the end of the list. If the given item is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGNumberList/appendItem)
    
    #### Parameters
    
    -   newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)
    
    #### Returns [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)
    

### clear[](#clear)

-   clear(): void[](#clear-1)
    
    The **`clear()`** method of the SVGNumberList interface clears all existing items from the list, with the result being an empty list.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGNumberList/clear)
    
    #### Returns void
    

### getItem[](#getitem)

-   getItem(index: number): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)[](#getitem-1)
    
    The **`getItem()`** method of the SVGNumberList interface returns the specified item from the list. The returned item is the item itself and not a copy. Any changes made to the item are immediately reflected in the list. The first item is indexed 0.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGNumberList/getItem)
    
    #### Parameters
    
    -   index: number
    
    #### Returns [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)
    

### initialize[](#initialize)

-   initialize(newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)[](#initialize-1)
    
    The **`initialize()`** method of the SVGNumberList interface clears all existing items from the list and re-initializes the list to hold the single item specified by the parameter. If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. The return value is the item inserted into the list.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGNumberList/initialize)
    
    #### Parameters
    
    -   newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)
    
    #### Returns [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)
    

### insertItemBefore[](#insertitembefore)

-   insertItemBefore(newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/), index: number): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)[](#insertitembefore-1)
    
    The **`insertItemBefore()`** method of the SVGNumberList interface inserts a new item into the list at the specified position. The first item is indexed 0. The inserted item is the item itself and not a copy.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGNumberList/insertItemBefore)
    
    #### Parameters
    
    -   newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)
    -   index: number
    
    #### Returns [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)
    

### removeItem[](#removeitem)

-   removeItem(index: number): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)[](#removeitem-1)
    
    The **`removeItem()`** method of the SVGNumberList interface removes an existing item at the given index from the list.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGNumberList/removeItem)
    
    #### Parameters
    
    -   index: number
    
    #### Returns [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)
    

### replaceItem[](#replaceitem)

-   replaceItem(newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/), index: number): [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)[](#replaceitem-1)
    
    The **`replaceItem()`** method of the SVGNumberList interface replaces an existing item in the list with a new item. If the new item is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the item.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGNumberList/replaceItem)
    
    #### Parameters
    
    -   newItem: [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)
    -   index: number
    
    #### Returns [SVGNumber](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.SVGNumber/)
