>empty space with a comma?

I think that only works with trailing params. For example this is not
possible:

const foo = (a,  , c) => {}

>Today, you can write: const foo = (a, b, _) => {}

However that does throw with:

const foo = (a, _, _) => {}

>You can already write: const [ , setState] = useState(0)

Thanks i forgot about that.

On Fri, Jan 11, 2019 at 5:31 PM Claude Pache <claude.pa...@gmail.com> wrote:

>
>
> > Le 11 janv. 2019 à 14:02, Sultan <thysul...@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
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to