2 comments
Comment actions Permalink

Now it is recognizing after first property but still first word still unrecognized

 

0
Comment actions Permalink

what is `e` here - event? The IDE has no idea what your e.target.parentNode element is, and property 'previousElementSubling' does not exist on type 'Node & ParentNode'. You need casting the parentNode to some type that implements NonDocumentTypeChildNode (https://developer.mozilla.org/en-US/docs/Web/API/NonDocumentTypeChildNode) - to Element, for example:

function f(e) {
const parent = /**Element*/e.target.parentNode;
console.log(parent.previousElementSibling.previousElementSibling.previousElementSibling);
}
0

Please sign in to leave a comment.