Class NodeList
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NodeList objects are collections of nodes, usually returned by properties such as ChildNodes and methods such as Document.QuerySelectorAll.
[Value("NodeList")]
public class NodeList
- Inheritance
-
NodeList
- Derived
- Inherited Members
Remarks
This interface was an attempt to create an unmodifiable list and only continues to be supported to not break code that's already using it. Modern APIs represent list structures using types based on JavaScript arrays, thus making many array methods available, and at the same time imposing additional semantics on their usage (such as making their items read-only).
These historical reasons do not mean that you as a developer should avoid NodeList. You don't create NodeList objects yourself, but you get them from APIs such as Document.QuerySelectorAll, and these APIs are not deprecated. However, be careful of the semantic differences from a real array.
Although NodeList is not an Array, it is possible to iterate over it with forEach(). It can also be converted to a real Array using ArrayFrom.
Constructors
NodeList()
public NodeList()
Properties
this[int]
public Node this[int i] { get; set; }
Parameters
iint
Property Value
Length
The NodeList.length property returns the number of items
in a NodeList.
[Value("length")]
public ulong Length { get; }
Property Value
- ulong
An integer value representing the number of items in a
NodeList.