Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

array merge in javascript

function mergeArrays(arr1, arr2) {
  return Array.from(new Set(arr1.concat(arr2).sort((a,b) => (a-b))));
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #array #merge #javascript
ADD COMMENT
Topic
Name
8+7 =