Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var jobs = [{
    name: "worker",
    priority: 2,
    available: true
},{
    name: "worker2",
    priority: 2,
    available: true
}];
var offers = [{
     name: "worker",
     bool: true
},{
     name: "worker",
     bool: false,
     item: 1
},{
     name: "worker2",
     text: "Date.Now()"
},{
     name: "worker2",
     bool: true,
     item: 1
}];
var result = jobs.map(function(item){
  var data = [item].concat(data, offers.filter(function(i){return i.name===item.name;}));
  return angular.extend.apply(null, data);
});
console.log(result);
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers