Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://jashkenas.github.io/underscore/underscore-min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var arr= [{
        id: '1',
        title: 40
    }, {
        id: '2',
        title: 40
    }, {
        id: '1',
        title: 60
    }];
var res = _.groupBy(arr, function(x){ return x.id; });
console.log(res["1"]);
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers