Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var a = [1,4,78,98];
var b= [45,56,3];
var c = [2,3,45];
function union() {
  var arrs = [].concat.apply([], arguments);
  return arrs.filter(function(v, i) {
    return arrs.indexOf(v) == i;
  });
}
console.log('Custom:', union(a,b,c));
console.log('Unders:', _.union(a,b,c));
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
elclanrspro
0viewers