Closed
Description
TypeScript Version: 3.1.0-dev.20180726
Search Terms: DomTokenList forEach classList
Code
const body:HTMLElement = document.body;
body.classList.forEach((attr)=>{
/* Some code */
);
Expected behavior:
File just Compiles wwithout generating an error according to https://developer.mozilla.org/de/docs/Web/API/DOMTokenList/forEach
Actual behavior:
client/main.ts:24:20 - error TS2339: Property 'forEach' does not exist on type 'DOMTokenList'.
24 body.classList.forEach((attr)=>{
~~~~~~~
Playground Link:
https://www.typescriptlang.org/play/#src=.....
The file from where VS Code loads the DOMTokenList is: /usr/share/code/resources/app/extensions/node_modules/typescript/lib/lib.dom.d.ts