Typescript: バグ:for..ofはNodeListでは機能しません

作成日 2016年11月04日  ·  1コメント  ·  ソース: microsoft/TypeScript



TypeScriptバージョン:毎晩(2.1.0-dev.201xxxxx)

コード

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

予想される行動:
コンパイルする必要があります。

実際の動作:
error TS2495: Type 'NodeListOf<Element>' is not an array type or a string type

Duplicate

最も参考になるコメント

image

>すべてのコメント

image

このページは役に立ちましたか?
0 / 5 - 0 評価