_.concat

Creates a new array concatenating array with any additional arrays and/or values.

  1. // Underscore/Lodash
  2. var array = [1]
  3. var other = _.concat(array, 2, [3], [[4]])
  4.  
  5. console.log(other)
  6. // output: [1, 2, 3, [4]]
  7.  
  8. // Native
  9. var array = [1]
  10. var other = array.concat(2, [3], [[4]])
  11.  
  12. console.log(other)
  13. // output: [1, 2, 3, [4]]

Browser Support for Array.prototype.concat()

ChromeEdgeFirefoxIEOperaSafari
1.0 ✔1.0 ✔5.5 ✔