-2

I have 2 different array that I got value from different checkbox and now I want to combine those value into another array.

This is what I want to achieve.

output 1 : [5,6]
output 2 :[3,9]

result : [3,5,6,9]

assuming I have already declare the array and got the value for dt_temp and ab_temp this is what I have tried

var a = dt_temp;
var b = ab_temp;

 result_temp.push.apply(a,b);
 console.log(result_temp);

but the current code I tried I only got this output. I got empty array []

enter image description here

0

1 Answer 1

2

use merge to combine them

$.merge(a, b);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.