SVGNumberList
The SVGNumberList interface defines a list of numbers.
Indexable
[index: number]: SVGNumber
Methods
[iterator]()
iterator: ArrayIterator<SVGNumber>;
Returns
appendItem()
appendItem(newItem): SVGNumber;
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.
Parameters
| Parameter | Type |
|---|---|
newItem | SVGNumber |
Returns
clear()
clear(): void;
The clear() method of the SVGNumberList interface clears all existing items from the list, with the result being an empty list.
Returns
void
getItem()
getItem(index): SVGNumber;
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.
Parameters
| Parameter | Type |
|---|---|
index | number |
Returns
initialize()
initialize(newItem): SVGNumber;
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.
Parameters
| Parameter | Type |
|---|---|
newItem | SVGNumber |
Returns
insertItemBefore()
insertItemBefore(newItem, index): SVGNumber;
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.
Parameters
| Parameter | Type |
|---|---|
newItem | SVGNumber |
index | number |
Returns
removeItem()
removeItem(index): SVGNumber;
The removeItem() method of the SVGNumberList interface removes an existing item at the given index from the list.
Parameters
| Parameter | Type |
|---|---|
index | number |
Returns
replaceItem()
replaceItem(newItem, index): SVGNumber;
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.
Parameters
| Parameter | Type |
|---|---|
newItem | SVGNumber |
index | number |
Returns
Properties
length
readonly 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.
numberOfItems
readonly numberOfItems: number;
The numberOfItems property of the SVGNumberList interface returns the number of items in the list. length is an alias of it.