isElement
Checks whether the given value
is a DOM Element
.
isElement
method to verify the parameter type, avoiding errors caused by passing non - Element values.value
(T
): The value to check.value is T & Element
): Returns true
if the value is a DOM Element, and narrows the type to T & Element
.