[JavaScript] The variable type is not set for "for .. of .."

Hi. When I set the type of the variable and using the "for (let xyz of zyx)" is not working

/** @type {HTMLCollectionOf<HTMLVideoElement>} */
or
/** @type {NodeListOf<HTMLVideoElement>} */
let list = document.getElementsByTagName('video');

for (const listElement (the type is any) of list) {
listElement (the type is any)
}

Other thing is when I set the variable from list[i] I get other autocomplete.

for (let i = 0; i < list.length; i++)
{
let video = list[i];

  list[i]. (I get the good autocomplete)
 video. (I get weird autocomplete)
}

I see the last version to working good is as IntelliJ IDEA 2019.2.4

0
1 comment

Please vote for https://youtrack.jetbrains.com/issue/WEB-49699 to be notified on any progress with it

0

Please sign in to leave a comment.