dimanche 12 juillet 2020

Why this always returns me "watched"? [closed]

var movies= [
    movie= {
        title: "padmavat",
        rattings: 3.4,
        watched: true
    },
    movie2= {
        title: "soorywanshi",
        rattings: 4.3,
        watched: false
    },
    movie3= {
        title: "dilwale",
        rattings: 2.2,
        watched: true
    },
    movie4= {
        title: "fucked up!!",
        rattings: 5.0,
        watched: false
    },
]


movieWatched(){
    for(j=0; j<movies.length; j++){
        if(movies[j].watched){
            return "watched "
        }
        else {
            return "not seen "
        }
    }
}

Aucun commentaire:

Enregistrer un commentaire