Title: First Argument in Function.prototype.call should be optional · Issue #44530 · microsoft/TypeScript · GitHub
Open Graph Title: First Argument in Function.prototype.call should be optional · Issue #44530 · microsoft/TypeScript
X Title: First Argument in Function.prototype.call should be optional · Issue #44530 · microsoft/TypeScript
Description: 🕗 Version & Regression Information Occurs in the latest Version (4.3.2) and nightly version 💻 Code Function.prototype.call combined with Optional Chaining is a nice way to only call a method if the method is defined (see this thread). fo...
Open Graph Description: 🕗 Version & Regression Information Occurs in the latest Version (4.3.2) and nightly version 💻 Code Function.prototype.call combined with Optional Chaining is a nice way to only call a method if the...
X Description: 🕗 Version & Regression Information Occurs in the latest Version (4.3.2) and nightly version 💻 Code Function.prototype.call combined with Optional Chaining is a nice way to only call a method if...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/44530
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"First Argument in Function.prototype.call should be optional","articleBody":"### 🕗 Version \u0026 Regression Information\r\nOccurs in the latest Version (4.3.2) and nightly version\r\n\r\n### 💻 Code\r\n[Function.prototype.call](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call) combined with [Optional Chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) is a nice way to only call a method if the method is defined (see [this thread](https://stackoverflow.com/a/65082211/11603006)). \r\n```\r\nfoo?.call()\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\nTs complains: `Expected at least 1 arguments, but got 0` \r\n\r\n### 🙂 Expected behavior\r\n\r\nI expect that this works as the first argument is actually optional according to [Mozilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call#using_call_to_invoke_a_function_and_without_specifying_the_first_argument) and own observations. \r\n","author":{"url":"https://github.com/jonath92","@type":"Person","name":"jonath92"},"datePublished":"2021-06-10T06:48:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/44530/TypeScript/issues/44530"}
| 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:c45a75f9-4c6e-4dee-c8a6-66de2b1072af |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB94:4A39E:3F7B24:56768A:6A61A9B9 |
| html-safe-nonce | b50feaf95cfe82d87e382f5dc971b07e0fa905bb7dbbcf0cf84533ec450c0b2c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjk0OjRBMzlFOjNGN0IyNDo1Njc2OEE6NkE2MUE5QjkiLCJ2aXNpdG9yX2lkIjoiMTE5MzAzNDc1NzE3OTU1MDEzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | da9b97ba6e9b0ba9b0895776ea1bc1369834cf5e59c51746c19ed22959d824fd |
| hovercard-subject-tag | issue:916975783 |
| 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/44530/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cfb7d31fd1fddae44ffffc469584c21e53b91be8ec4051a65cee0fee5af61533/microsoft/TypeScript/issues/44530 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cfb7d31fd1fddae44ffffc469584c21e53b91be8ec4051a65cee0fee5af61533/microsoft/TypeScript/issues/44530 |
| og:image:alt | 🕗 Version & Regression Information Occurs in the latest Version (4.3.2) and nightly version 💻 Code Function.prototype.call combined with Optional Chaining is a nice way to only call a method if the... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jonath92 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6f4633bcf01c1ad14b73fd07dd39ac31d61f3d3c2578ee08ec1792b7b351eeb9 |
| 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 | ac296ae7f21856f1f92adbad22f870b6fbb4b907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width