for example if I have two arrys
arr1[10,20,30]
arr2[40,50,60]
can I get help on how to merge them to get arr1[10,20,30,40,50,60]
costapico 0
Newbie Poster
Recommended Answers
Jump to PostLike many things in coding, there are a couple approaches. The simplest is to just use the JS built in function concat.
var newArray = arr1.concat(arr2);
Another approach (and less efficient) would be to loop through the second array and push each element onto the first using
…
All 4 Replies
scrappedcola 11
Posting Whiz in Training
Jayavardhan -2
Light Poster
Taywin 312
Posting Virtuoso
scrappedcola 11
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.