Typescript: ๋ฒ„๊ทธ: for..of๋Š” NodeList์—์„œ ์ž‘๋™ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2016๋…„ 11์›” 04์ผ  ยท  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 ๋“ฑ๊ธ‰