I'm new to learning coding. Having a bit of a hard time with for loops and forEach. My code is not working for some reason, and I don't know what the error is. Does anyone see anything that I need to fix?
var myMovies = [
{name: "Gladiator",
rating: 5,
seen: true
},
{name: "Vanilla Sky",
rating: 4.5,
seen: true
},
{name: "Beautiful Mind",
rating: 5,
seen:true
},
{name: "The Happytime Murders",
rating: 3.5,
seen: false
}
];
var movies = myMovies;
for(i = 0; i < 3; i ++)
if(movies.seen){
console.log("You have seen " + movies.name + "-" + movies.rating);
}else
console.log("You haven't seen " + movies.name + "-" + movies.rating);