Title: for-of does not work with DOM collections when target is ES3 or ES5 · Issue #2696 · microsoft/TypeScript · GitHub
Open Graph Title: for-of does not work with DOM collections when target is ES3 or ES5 · Issue #2696 · microsoft/TypeScript
X Title: for-of does not work with DOM collections when target is ES3 or ES5 · Issue #2696 · microsoft/TypeScript
Description: var paragraphs = document.querySelectorAll("p"); for (let p of paragraphs) { console.log(p); } foo.ts(2,15): error TS2495: Type 'NodeList' is not an array type or a string type. Is it because the standard emit will have the wrong behavio...
Open Graph Description: var paragraphs = document.querySelectorAll("p"); for (let p of paragraphs) { console.log(p); } foo.ts(2,15): error TS2495: Type 'NodeList' is not an array type or a string type. Is it because the s...
X Description: var paragraphs = document.querySelectorAll("p"); for (let p of paragraphs) { console.log(p); } foo.ts(2,15): error TS2495: Type 'NodeList' is not an array type or a string type. I...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/2696
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"for-of does not work with DOM collections when target is ES3 or ES5","articleBody":"``` typescript\nvar paragraphs = document.querySelectorAll(\"p\");\nfor (let p of paragraphs) {\n console.log(p);\n}\n```\n\n```\nfoo.ts(2,15): error TS2495: Type 'NodeList' is not an array type or a string type.\n```\n\nIs it because the standard emit will have the wrong behavior for live lists that are modified during iteration? A `[].slice.call()` in the emit would fix that, but perhaps that detracts from wanting to keep the output as close to the original as possible...\n","author":{"url":"https://github.com/Arnavion","@type":"Person","name":"Arnavion"},"datePublished":"2015-04-09T22:20:05Z","url":"https://github.com/microsoft/TypeScript/issues/2696"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bccb805e-ee99-6407-d730-b39e4f56764d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 83D6:2DBB21:9F0FD1:D5B778:6B00ECA9 |
| html-safe-nonce | 51e4a790521dc3337418a6f65fca4f1b16e5fc611b894fa4299670645e809021 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0Q2OjJEQkIyMTo5RjBGRDE6RDVCNzc4OjZCMDBFQ0E5IiwidmlzaXRvcl9pZCI6IjgyMDA2NDI0MzQ1Nzc3ODgwNzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 91283fc4a5b01f143cbe06607a725ff7b52e5c899aca2f4dd14d126e26364ab6 |
| hovercard-subject-tag | issue:67462823 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/2696/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a6c02fc328b83a11081a6b63af0e071ae7db61865f7a145516be8a9a196038e9/microsoft/TypeScript/issues/2696 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a6c02fc328b83a11081a6b63af0e071ae7db61865f7a145516be8a9a196038e9/microsoft/TypeScript/issues/2696 |
| og:image:alt | var paragraphs = document.querySelectorAll("p"); for (let p of paragraphs) { console.log(p); } foo.ts(2,15): error TS2495: Type 'NodeList' is not an array type or a string type. Is it because the s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Arnavion |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width