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 }
];
function getShowNames(shows) {
  var names = [],
      couter, 
      show;
 
  for(counter = 0; counter < shows.length; counter++ ){
    show = shows[counter];
    names.push(show.name);
  }
  
//   shows.forEach(function(show) {
//     names.push(show.name);
//   });
  return names;
}
var shows = getShowNames(IMDBShows);
console.log(JSON.stringify(shows));
// imdb.forEach(function(show) {
//     names.push(show.name);
//   });
Output

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

Dismiss x
public
Bin info
amitjain1307pro
0viewers