Hacker News new | ask | show | jobs
by gherkinnn 2271 days ago
useSound returns an array (used like a tuple here).

The syntax you see here is Array Destructuring. This way you access the 0th element directly.

Equivalent of:

const hook = useSound() const play = hook[0]

If you want to just take the 2nd item, you can destructure like this: const [, pause] = useSound().