Typescript: bug: for..of funktioniert nicht mit NodeList

Erstellt am 4. Nov. 2016  ·  1Kommentar  ·  Quelle: microsoft/TypeScript



TypeScript-Version: nightly (2.1.0-dev.201xxxxx)

Code

// A *self-contained* demonstration of the problem follows...
for(const a of document.querySelectorAll('div')) {}

Erwartetes Verhalten:
Es sollte kompilieren.

Tatsächliches Verhalten:
error TS2495: Type 'NodeListOf<Element>' is not an array type or a string type

Duplicate

Hilfreichster Kommentar

image

>Alle Kommentare

image

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen