Title: Generator with Array Spread · Issue #11970 · microsoft/TypeScript · GitHub
Open Graph Title: Generator with Array Spread · Issue #11970 · microsoft/TypeScript
X Title: Generator with Array Spread · Issue #11970 · microsoft/TypeScript
Description: Version 2.1.0-dev.20161031 const g = function*(){ yield 1; } console.log([...g()]); Compiles to the following which throws an error (treating the generator as an array, not an iterable): var g = function* () { yield 1; }; console.log(g()...
Open Graph Description: Version 2.1.0-dev.20161031 const g = function*(){ yield 1; } console.log([...g()]); Compiles to the following which throws an error (treating the generator as an array, not an iterable): var g = fu...
X Description: Version 2.1.0-dev.20161031 const g = function*(){ yield 1; } console.log([...g()]); Compiles to the following which throws an error (treating the generator as an array, not an iterable): var g = fu...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/11970
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generator with Array Spread","articleBody":"`Version 2.1.0-dev.20161031`\r\n\r\n```\r\nconst g = function*(){\r\n yield 1;\r\n}\r\n\r\nconsole.log([...g()]);\r\n```\r\n\r\nCompiles to the following which throws an error (treating the generator as an array, not an iterable):\r\n```\r\nvar g = function* () {\r\n yield 1;\r\n};\r\nconsole.log(g().slice());\r\n//# sourceMappingURL=build.js.map\r\n```\r\n\r\nPossible solution using `Array.from`:\r\n```\r\nvar g = function* () {\r\n yield 1;\r\n};\r\nconsole.log(Array.from(g()).slice());\r\n//# sourceMappingURL=build.js.map\r\n```\r\n","author":{"url":"https://github.com/johnlindquist","@type":"Person","name":"johnlindquist"},"datePublished":"2016-11-01T03:53:45Z","url":"https://github.com/microsoft/TypeScript/issues/11970"}
| 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:e982ddd8-0be8-f7e7-e019-5acaf9836d81 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D63C:2978F1:673831:87038B:6B00D2B3 |
| html-safe-nonce | 709b8b697af1d8d00783f175ccecb125b503fbe19970b3f7a857c9b539c5b23a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjNDOjI5NzhGMTo2NzM4MzE6ODcwMzhCOjZCMDBEMkIzIiwidmlzaXRvcl9pZCI6IjM3ODgxMjg0NzIxNjYwOTM0OTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a9251fc0d34a2d30cae1a8d312a7c5cc3e37b0a968fa0d9f9f460d37392df801 |
| hovercard-subject-tag | issue:186453357 |
| 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/11970/issue_layout |
| twitter:image | https://opengraph.githubassets.com/14a839979c8e5e1bf13d73268c2701964114a813d3361cfe868380230670f13d/microsoft/TypeScript/issues/11970 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/14a839979c8e5e1bf13d73268c2701964114a813d3361cfe868380230670f13d/microsoft/TypeScript/issues/11970 |
| og:image:alt | Version 2.1.0-dev.20161031 const g = function*(){ yield 1; } console.log([...g()]); Compiles to the following which throws an error (treating the generator as an array, not an iterable): var g = fu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | johnlindquist |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85bbdfe2b6ba16e234513bc6ceff5d848ef8449820c900692a2b4e67061931e5 |
| 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 | 4943239a6d2c591325dad6e5c313e1cafda877f6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width