Doesn't this encourage inefficient coding?
One of the examples in [this gist](https://gist.github.com/nicolo-ribaudo/d264e424b618e7deaeca1d6e4f16a7c0) is:
---
```javascript
if (node) {
node.kind = "init";
node.type = "Property";
}
```
could be rewritten as
```javascript
node?.kind = "init";
node?.type = "Property";
```
---
This is performing the same test twice at runtime.
The original was more efficient.
2 条评论