I would avoid using fixed numbers, this is prone to errors.
Also there are way to “shorten” the syntax so you’d type less, but that doesn’t necessary means achieving better performances, so it’s more an “aesthetic” preference.
For example I am lazy, so I don’t like to type all those string concatenation thus I prefer Template strings.
Also typing all that for conditions is boring, a forEach will do as well.
Finally I try to not repeat myself, so I would try a way to avoid typing those variables more than once, if possible.
moviesArray.forEach(movie => {
const {title, rating, hasWatched} = movie;
const s = hasWatched
? `You have watched ${title} - ${rating} stars`
: `You have not seen ${title} - ${rating} stars`;
console.log(s)
});
Again this is mainly aesthetic preference: nothing “better” per-se in this code compared to what you have