Skip to content

Instantly share code, notes, and snippets.

@brunosabot
Created March 30, 2022 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunosabot/def326b3fda8c91f949dcc2ea5d42207 to your computer and use it in GitHub Desktop.
Save brunosabot/def326b3fda8c91f949dcc2ea5d42207 to your computer and use it in GitHub Desktop.
const walkingAnimals = ["cats", "dogs"];
const flyingAnimals = ["eagle", "falcon"];
const animals1 = [...walkingAnimals, ...flyingAnimals];
const animals2 = ["dolphin", ...flyingAnimals, ...walkingAnimals];
console.log(animals1); // ["cats", "dogs", "eagle", "falcon"]
console.log(animals2); // ["dolphin", "eagle", "falcon", "cats", "dogs"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment