Title: for-of with map.keys() gives TS2495 · Issue #11209 · microsoft/TypeScript · GitHub
Open Graph Title: for-of with map.keys() gives TS2495 · Issue #11209 · microsoft/TypeScript
X Title: for-of with map.keys() gives TS2495 · Issue #11209 · microsoft/TypeScript
Description: TypeScript Version: 2.0.3 Code let map = new Map
Open Graph Description: TypeScript Version: 2.0.3 Code let map = new Map
X Description: TypeScript Version: 2.0.3 Code let map = new Map<string, string>(); map.set('hello', 'world'); for (let key of map.keys()) { console.log(key); } Expected behavior: It should n...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/11209
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"for-of with map.keys() gives TS2495","articleBody":"**TypeScript Version:** 2.0.3\n\n**Code**\n\n``` ts\nlet map = new Map\u003cstring, string>();\nmap.set('hello', 'world');\n\nfor (let key of map.keys()) {\n console.log(key);\n}\n```\n\n**Expected behavior:**\nIt should not throw.\n\n**Actual behavior:** \nIt throws `error TS2495: Type 'IterableIterator\u003cstring>' is not an array type or a string type.`\n\n**tsconfig.json:**\n\n``` json\n{\n \"compilerOptions\": {\n \"experimentalDecorators\": true,\n \"lib\": [\n \"dom\",\n \"es7\",\n \"scripthost\"\n ],\n \"moduleResolution\": \"node\",\n \"noImplicitAny\": false,\n \"preserveConstEnums\": true,\n \"pretty\": true,\n \"removeComments\": false,\n \"sourceMap\": true,\n \"target\": \"ES5\"\n }\n}\n```\n\ncc: @Mischi\n","author":{"url":"https://github.com/davidreher","@type":"Person","name":"davidreher"},"datePublished":"2016-09-28T13:39:02Z","url":"https://github.com/microsoft/TypeScript/issues/11209"}
| 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:d56c7991-2af0-7c30-3e46-4e78631199e9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ADC8:1D86C4:561BF3:6F11F3:6B00DB17 |
| html-safe-nonce | be3377345d2b5a2d3dc069355c6e92674ab43f2ecbfb83506631f0d1e1a72327 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBREM4OjFEODZDNDo1NjFCRjM6NkYxMUYzOjZCMDBEQjE3IiwidmlzaXRvcl9pZCI6IjE0MzA3NDM2NDM0OTIyNDQyNDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e1afa96b00ffc8ced73dd05594edb686ec99968df0520c5dfeadf78c0b71c60d |
| hovercard-subject-tag | issue:179775537 |
| 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/11209/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ebfdfb6984804497d57e76f7cef8ce0e93ef57dc93e7bee6c4bc67c73ab4fd67/microsoft/TypeScript/issues/11209 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ebfdfb6984804497d57e76f7cef8ce0e93ef57dc93e7bee6c4bc67c73ab4fd67/microsoft/TypeScript/issues/11209 |
| og:image:alt | TypeScript Version: 2.0.3 Code let map = new Map |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | davidreher |
| hostname | github.com |
| expected-hostname | github.com |
| None | a481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b |
| 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 | 84c8c5cc25e2fb7f2308428458538436baecc6d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width