Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var IMDBShows = [
   {
   genre: ["crime", "drama"],
    showlist:[
      { name: "House of cards", rating: 9.1, users: 204420 },
      { name: "Breaking Bad", rating: 9.5, users: 664927 }
     ]
   },
   {
     genre: [" Adventure", "Fantasy"],
    showlist:[
    { name: "Once Upon a Time in Wonderland", rating: 7.1, users: 8705 },
    { name: "Once upon a time", rating: 9.1, users: 139421 }]
   }
];
Array.prototype.concatAll = function() {
  var results = [];
  
  this.forEach(function(subArray) {
    subArray.forEach(function(item) {
      results.push(item);    
    });
  });  
  return results;
};
var filteredShownames = 
  IMDBShows.
    map(function(shows){
      return shows.showlist.filter(function(show) {
        return show.rating >= 9.00;
      });
    }).concatAll();
filteredShownames.forEach(function(name) {
  console.log(name);
});
Output

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

Dismiss x
public
Bin info
amitjain1307pro
0viewers