happy-dom
Version:
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.
23 lines (21 loc) • 399 B
text/typescript
/**
* Class list.
*/
export default class NodeList<T> extends Array<T> {
/**
* Returns `Symbol.toStringTag`.
*
* @returns `Symbol.toStringTag`.
*/
public get [Symbol.toStringTag](): string {
return this.constructor.name;
}
/**
* Returns item by index.
*
* @param index Index.
*/
public item(index: number): T {
return index >= 0 && this[index] ? this[index] : null;
}
}