Skip to content

Instantly share code, notes, and snippets.

@iamgoangle
Created August 11, 2017 08:04
Show Gist options
  • Select an option

  • Save iamgoangle/0fc2b61ccd4e3b84cdd2f2d890349ab1 to your computer and use it in GitHub Desktop.

Select an option

Save iamgoangle/0fc2b61ccd4e3b84cdd2f2d890349ab1 to your computer and use it in GitHub Desktop.
concatenate array
const arrA = [1, 2, 3];
const arrB = [4, 5, 6];
arrA.push(...arrB); // [1, 2, 3, 4, 5, 6]
let arrC = [1, 2, 3];
let arrD = [4, 5, 6];
arrC = [...arrC, ...arrD]; // [1, 2, 3, 4, 5, 6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment