var array3 = array1.concat(array2);
array3 = array3.sort(function(a, b) { return a > b; });
array3 = array3.filter(function(num, index) { return num !== array3[index + 1]; });
array3 will have only unique values
this also does the job in two loops which is pretty inexpensive, it should be noted that sort() and filter() are ECMA5 functions and not supported in older browsers, also i usually use a library like underscore so i don't have rewrite these functions for each project i work on, underscore has a .unique() method which obviously is less code and more clearly states the intention of the operation