JS Merging arrays

JS Merging arrays

·

1 min read

Twitter Youtube

Merging two arrays in javascript:

  1. Using spread operator
  2. using concat

When to use what: Spread can work only when our inputs are of type arrays. concat works better in all scenarios.

3.png

4.png