Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

merg two array js

let ar1 = [1,2,3,4,5]
let ar2 = [6,7,8,9,10]

let merge = [...ar1,...ar2]
console.log(merge) // [1,2,3,4,5,6,7,8,9,10]
Comment

array merge in javascript

function mergeArrays(arr1, arr2) {
  return Array.from(new Set(arr1.concat(arr2).sort((a,b) => (a-b))));
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: vuejs reset component 
Javascript :: timestamp to date 
Javascript :: js sort strings lowercase and uppercase 
Javascript :: react scroll on top while transition 
Javascript :: reverse individual words in a sentence javascript 
Javascript :: javascript last in a list 
Javascript :: express get 
Javascript :: get size of array in bytes javascript 
Javascript :: datatable highlight cells based on their content 
Javascript :: Get rid of white space around Angular Material modal dialog 
Javascript :: javascript return first match in array 
Javascript :: string methods javascript 
Javascript :: puppeteer 
Javascript :: push values to data object in vue 
Javascript :: get javascript parameter 
Javascript :: react native Setting a timer for a long period of time 
Javascript :: javascript sort an array 
Javascript :: how to recognize an array in javascript 
Javascript :: Using axios send a GET request to the address: 
Javascript :: vue router transition 
Javascript :: compare strings js 
Javascript :: 2d array javascript 
Javascript :: javascript how to remove first element of array 
Javascript :: refresh ajax jquery 
Javascript :: jquey datatables 
Javascript :: import an image react in the public folder 
Javascript :: run javascript in iframe 
Javascript :: javascript remove css link 
Javascript :: js play sound 
Javascript :: get min/max array 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =