alongubkin / alongubkin/spider

Null coalescing operator

未关闭
#97 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
JavaScript
星标
1.3k
派生
46
PR 合并指标
30 天内没有已合并 PR

描述

I have a couple of points about the null coalescing operator, `??`.

Firstly, why isn't it still `||` like vanilla JS and the rest of the programming languages[1]?
Changing it just for the sake of change just introduces confusion is not an improvement, IMHO.

Secondly, the ruby-esque `||=` operator would be amazing.

```
a ||= b
```

becomes

```
a = a || b
```

_(this can be `??=` if you're quite set on keeping the `??`)_

[1] Except the unruly PHP

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。