{"action":"created","issue":{"url":"https://api.github.com/repos/tc39/proposal-nullish-coalescing/issues/17","repository_url":"https://api.github.com/repos/tc39/proposal-nullish-coalescing","labels_url":"https://api.github.com/repos/tc39/proposal-nullish-coalescing/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/tc39/proposal-nullish-coalescing/issues/17/comments","events_url":"https://api.github.com/repos/tc39/proposal-nullish-coalescing/issues/17/events","html_url":"https://github.com/tc39/proposal-nullish-coalescing/issues/17","id":275993177,"node_id":"MDU6SXNzdWUyNzU5OTMxNzc=","number":17,"title":"Change operator to ||| and reserve ?? for optional chaining","user":{"login":"dfahlander","id":6791329,"node_id":"MDQ6VXNlcjY3OTEzMjk=","avatar_url":"https://avatars3.githubusercontent.com/u/6791329?v=4","gravatar_id":"","url":"https://api.github.com/users/dfahlander","html_url":"https://github.com/dfahlander","followers_url":"https://api.github.com/users/dfahlander/followers","following_url":"https://api.github.com/users/dfahlander/following{/other_user}","gists_url":"https://api.github.com/users/dfahlander/gists{/gist_id}","starred_url":"https://api.github.com/users/dfahlander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfahlander/subscriptions","organizations_url":"https://api.github.com/users/dfahlander/orgs","repos_url":"https://api.github.com/users/dfahlander/repos","events_url":"https://api.github.com/users/dfahlander/events{/privacy}","received_events_url":"https://api.github.com/users/dfahlander/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-11-22T09:13:37Z","updated_at":"2018-12-01T00:13:35Z","closed_at":null,"author_association":"NONE","body":"As the form `x || defaultValue` is a widely known pattern for javascript developers, a natural and more intuitive operator for this proposal would therefore rather be `|||` (three pipe-signs instead of two). This goes in line with the relation between the `===` and `==` operators.\r\n\r\nGoing this direction would also also free up the `??` operator to be used for [optional chaining](https://github.com/tc39/proposal-optional-chaining), which is discussed [here](https://github.com/tc39/proposal-optional-chaining/issues/5#issuecomment-320423660)\r\n\r\n### Sample\r\n```js\r\nfunction foo(options) {\r\n   return options??.myOption ||| \"defaultValue\";\r\n}\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/tc39/proposal-nullish-coalescing/issues/comments/443378135","html_url":"https://github.com/tc39/proposal-nullish-coalescing/issues/17#issuecomment-443378135","issue_url":"https://api.github.com/repos/tc39/proposal-nullish-coalescing/issues/17","id":443378135,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzM3ODEzNQ==","user":{"login":"selipso","id":5407481,"node_id":"MDQ6VXNlcjU0MDc0ODE=","avatar_url":"https://avatars0.githubusercontent.com/u/5407481?v=4","gravatar_id":"","url":"https://api.github.com/users/selipso","html_url":"https://github.com/selipso","followers_url":"https://api.github.com/users/selipso/followers","following_url":"https://api.github.com/users/selipso/following{/other_user}","gists_url":"https://api.github.com/users/selipso/gists{/gist_id}","starred_url":"https://api.github.com/users/selipso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selipso/subscriptions","organizations_url":"https://api.github.com/users/selipso/orgs","repos_url":"https://api.github.com/users/selipso/repos","events_url":"https://api.github.com/users/selipso/events{/privacy}","received_events_url":"https://api.github.com/users/selipso/received_events","type":"User","site_admin":false},"created_at":"2018-12-01T00:13:35Z","updated_at":"2018-12-01T00:13:35Z","author_association":"NONE","body":"Repeating my response here about the word 'stricter' not being a comprehensive enough definition from one data point. This is still the best and most intuitive syntax by a long shot.\r\n\r\n> Then by that logic ||| is 'stricter' than || because nullish types are more limiting than the loosey-goosey || where !(0 || '') === true. Perfectly intuitive to me and easily explainable to even my high school students that I teach programming to.\r\n\r\n> Since we have only one point of reference for this syntax (== vs ===) I don't think 'stricter' is the right word for it but rather a \"restriction of scope\" in the underlying values comparison. We are essentially restricting scope by adding a third character in both cases.\r\n\r\n> With == vs === we are restricting scope to exact matches of the underlying data type. With || vs ||| we are restricting scope from \"falsy\" values to only null and undefined values.\r\n\r\noriginal source: https://github.com/tc39/proposal-optional-chaining/pull/48#issuecomment-443376578"}}
{"actor":{"display_login":"selipso"}}