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); }
Now it is recognizing after first property but still first word still unrecognized
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: