SVGLengthList: insertItemBefore() method

The insertItemBefore() method of the SVGLengthList 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.

Syntax

js
insertItemBefore(newItem, index)

Parameters

newItem

The SVGLength to add to the list.

index

A non-negative integer that specifies the index of the item to insert the new item before.

Return value

The SVGLength that was added to the list.

Exceptions

NoModificationAllowedError DOMException

Thrown when the list is read-only.

Examples

See SVGLengthList for a complete example.

Specifications