Optional assignment that creates keys if they dont exist
I'm curious if the following pattern is something this proposal will consider within scope.
```js
// An object containing optimized urls for `imageSrc` in various formats and resolutions
const manifest = {}
manifest[imageSrc] ??= {}
manifest[imageSrc][format] ??= {}
manifest[imageSrc][format][width] = url
```
Relevant: lodash's utility:
```js
_.setWith(manifest, '[${imageSrc}][${format}][${width}]', url)
```
6 条评论