Title: Solve the for-in / indexer mess · Issue #6346 · microsoft/TypeScript · GitHub
Open Graph Title: Solve the for-in / indexer mess · Issue #6346 · microsoft/TypeScript
X Title: Solve the for-in / indexer mess · Issue #6346 · microsoft/TypeScript
Description: /cc Vladimir Matveev (@vladima) Anders Hejlsberg (@ahejlsberg) Bill Ticehurst (@billti) Motivating Examples var arr = [1, 2, 3]; This should be an error (k is always a string): for(var k in arr) { if(k === 0) { ... } } This should not be...
Open Graph Description: /cc Vladimir Matveev (@vladima) Anders Hejlsberg (@ahejlsberg) Bill Ticehurst (@billti) Motivating Examples var arr = [1, 2, 3]; This should be an error (k is always a string): for(var k in arr) { ...
X Description: /cc Vladimir Matveev (@vladima) Anders Hejlsberg (@ahejlsberg) Bill Ticehurst (@billti) Motivating Examples var arr = [1, 2, 3]; This should be an error (k is always a string): for(var k in arr) { ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/6346
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Solve the for-in / indexer mess","articleBody":"/cc @vladima @ahejlsberg @billti \n### Motivating Examples\n\n``` ts\nvar arr = [1, 2, 3];\n```\n\nThis should be an error (`k` is always a `string`):\n\n``` ts\nfor(var k in arr) {\n if(k === 0) { ... }\n}\n```\n\nThis should _not_ be an error, even under no implicit any:\n\n``` ts\nfor(var k in arr) {\n if(arr[k] === 0) { ... }\n}\n```\n\nThis should _somehow?_ not be an error, even though it involves a coercion we would normally disallow\n\n``` ts\nfor(var k in arr) {\n if (k > 0) { ... }\n}\n```\n","author":{"url":"https://github.com/RyanCavanaugh","@type":"Person","name":"RyanCavanaugh"},"datePublished":"2016-01-04T19:29:03Z","url":"https://github.com/microsoft/TypeScript/issues/6346"}
| 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:3ca17e1f-71c7-12c5-c60a-c2cba1bcb1de |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E684:11486D:89FA9C:B4A054:6B00DDB1 |
| html-safe-nonce | 3ab04d2b45200b7cee585f58d9c79b3c63a1fc166a33b20fa09c0a24b7cd85b2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjg0OjExNDg2RDo4OUZBOUM6QjRBMDU0OjZCMDBEREIxIiwidmlzaXRvcl9pZCI6IjE3MTQwODc4MzcyMTQ3NjAzNjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a9c093eae719490324993790a07bb679159d366b321e378c9c42587d072039e3 |
| hovercard-subject-tag | issue:124822053 |
| 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/6346/issue_layout |
| twitter:image | https://opengraph.githubassets.com/80629378678756b3450df1f4992d00fc13e1ecb4a28b81b0d7dea0dbb6b298a6/microsoft/TypeScript/issues/6346 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/80629378678756b3450df1f4992d00fc13e1ecb4a28b81b0d7dea0dbb6b298a6/microsoft/TypeScript/issues/6346 |
| og:image:alt | /cc Vladimir Matveev (@vladima) Anders Hejlsberg (@ahejlsberg) Bill Ticehurst (@billti) Motivating Examples var arr = [1, 2, 3]; This should be an error (k is always a string): for(var k in arr) { ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RyanCavanaugh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width