Skip to content

Instantly share code, notes, and snippets.

@codeBelt
Last active February 6, 2022 17:53
Show Gist options
  • Save codeBelt/c83f3da49a55e2d292b0e4e7d04985a1 to your computer and use it in GitHub Desktop.
Save codeBelt/c83f3da49a55e2d292b0e4e7d04985a1 to your computer and use it in GitHub Desktop.
const arrayData = ['a', 'b', 'c', 'd', 'e'];
const { 0: first, [arrayData.length - 1]: last, ...rest } = arrayData;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment