0
[["510", "511", "512", "513"], ["514", "515"]]

I need to merge this into one.

It should look like this:

["510", "511", "512", "513", "514", "515"]

Can anyone help me with this using javascript ?

Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
uihelp
  • 198
  • 2
  • 7
  • 2
    And which language might this be? – StuartLC Dec 16 '14 at 06:05
  • Can you please show what you have already tried as well as what language you are working in? I'm sure if you do, someone will be able to answer your question. – DJG Dec 16 '14 at 06:06
  • My current logic is this: $('li').each(function () { if ( $(this).find('a').hasClass('filterItemSelected')) { arr.push($(this).find('a').attr('data-options').split(",")); } }); – uihelp Dec 16 '14 at 06:10

1 Answers1

2

Try this -

      var array1 =  ["510", "511", "512", "513"] 
      var array2 =  ["514", "515"]

       var concatArray = array1.concat(array2);

Hope this helps

Thomas
  • 498
  • 4
  • 16