Open
Description
Interface NodeList
is correctly typed
interface NodeList {
item(index: number): Node | null;
}
but interface NodeListOf
is missing the null
type:
interface NodeListOf<TNode extends Node> extends NodeList {
item(index: number): TNode;
}
therefore TSC does not warn about missing null checks:
const node = document.childNodes.item(999999).firstChild;
Metadata
Metadata
Assignees
Labels
No labels