Typescript: bug: for..of لا يعمل مع NodeList

تم إنشاؤها على ٤ نوفمبر ٢٠١٦  ·  1تعليق  ·  مصدر: microsoft/TypeScript



إصدار TypeScript: nightly (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 التقييمات

القضايا ذات الصلة

bgrieder picture bgrieder  ·  3تعليقات

seanzer picture seanzer  ·  3تعليقات

siddjain picture siddjain  ·  3تعليقات

CyrusNajmabadi picture CyrusNajmabadi  ·  3تعليقات

Antony-Jones picture Antony-Jones  ·  3تعليقات