根据lib.dom.d.ts,getElementsByTagName()将返回HTMLCollectionOf,但是我运行以下代码行:
var lessonList: HTMLCollectionOf<Element> = xmlDoc.getElementsByTagName("lesson");
我将收到此错误
TS 2322 Type NodeListOf <Element> is not assignable to type HTMLCollectionOf <Element> site:stackoverflow.com
顺便说一句,我正在使用Webstorm 2018.3