Hacker News new | ask | show | jobs
by marxama 4152 days ago
That's really nice. Is it possible to do the destructuring directly in the argument list?
1 comments

Yes:

    const description = ({name: {first, last}, occupation}) => `${first} is a ${occupation}`;
Edit: just noticed that `last` is not used, so we can remove it from the destructuring:

    const description = ({name: {first}, occupation}) => `${first} is a ${occupation}`;