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 = [
  { name: "House of cards", rating: 9.1, users: 204420 },
  { name: "Once upon a time", rating: 8.1, users: 139421 },
  { name: "Breaking Bad", rating: 9.5, users: 664927 }
];
Array.prototype.map = function(projectionFunction) {
    var results = [];
    this.forEach(function(itemInArray) {
        results.push(projectionFunction(itemInArray));
    });
    return results;
};
function getShowNames(shows) {
  return shows.map(function(show) {
    return show.name;
  });
}
var shows = getShowNames(IMDBShows);
console.log(JSON.stringify(shows));
Output

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

Dismiss x
public
Bin info
amitjain1307pro
0viewers