Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var movies = [
- {
- title: "In Bruges",
- rating: 5,
- hasWatched: true
- },
- {
- title: "Frozen",
- rating: 4.5,
- hasWatched: false
- },
- {
- title: "Mad Max Fury Road",
- rating: 5,
- hasWatched: true
- },
- {
- title: "Les Miserables",
- rating: 3.5,
- hasWatched: false
- }
- ];
- movies.forEach(function(movie) {
- if (movie.hasWatched == true) {
- var haveOrHaveNot = "have"
- }
- else {
- haveOrHaveNot = "have not"
- }
- console.log("You " + haveOrHaveNot + " seen " + "\""+movie.title+"\"" + " - " + movie.rating + " stars");
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement