DEV Community

Discussion on: Sorting an array into groups with reduce

Collapse
 
wolverineks profile image
Kevin Sullivan

This looks like a good use case for array destructuring.

const [account, domain] = email.split('@')

Nice article.

Collapse
 
jacobmparis profile image
Jacob Paris

Yes you're right — that's a better way to write that