Proposal: Placeholder operator

Claude Pache claude.pache at gmail.com
Fri Jan 11 14:31:13 UTC 2019



> Le 11 janv. 2019 à 14:02, Sultan <thysultan at gmail.com> a écrit :
> 
> Placeholder operator: !
> 
> Use in function parameters(maintains arity without creating a named binding):
> 
> const foo = (a, b, !) => {}

Today, you can write:

```js
const foo = (a, b, _) => { }
```

Is the complexity added to the language worth the feature?

> 
> Use in de-structuring(allows you to capture further along a tuple without creating a named binding):
> 
> const [!, setState] = useState(0)

You can already write:

```js
const [ , setState] = useState(0)
```

—Claude


More information about the es-discuss mailing list