Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ilyasozkurt
Created February 22, 2023 15:55
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 ilyasozkurt/a05ffd843b0c56fc10c683e588b51a3c to your computer and use it in GitHub Desktop.
Save ilyasozkurt/a05ffd843b0c56fc10c683e588b51a3c to your computer and use it in GitHub Desktop.
let arr = [1, 2, 3];
let newElements = [4, 5, 6];
arr = [...arr, ...newElements];
console.log(arr); // [1, 2, 3, 4, 5, 6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment