Skip to content

Instantly share code, notes, and snippets.

@epjuan21
Created October 21, 2019 15:37
Show Gist options
  • Save epjuan21/f4a63f9a0560edaf334b1468d2d7c9b7 to your computer and use it in GitHub Desktop.
Save epjuan21/f4a63f9a0560edaf334b1468d2d7c9b7 to your computer and use it in GitHub Desktop.
Merge arrays
// Merge Arrays
var fruits = [“apple”, “banana”, “orange”];
var meat = [“poultry”, “beef”, “fish”];
var vegetables = [“potato”, “tomato”, “cucumber”];
var food = […fruits, …meat, …vegetables];
console.log(food); // [“apple”, “banana”, “orange”, “poultry”, “beef”, “fish”, “potato”, “tomato”, “cucumber”]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment