Class object overlapping

im still trying to learn and im trying to make a group of actors be added to a movie class, i made it work but i still have problems because if you add another actor the last one dissappears, i tried with a loop but i could do nothing.

class Movie {
        this.title = title;
        this.year = year;
        this.duration = duration;

        this.actors = actors
class Actor {
    {  = name;
        this.age = age;

const terminator = new Movie('Terminator I', 1985, 60);
const arnold = new Actor('Arnold Schwarzenegger', 50);
const otherCast = [
    new Actor('Paul Winfield', 50),
    new Actor('Michael Biehn', 50),
    new Actor('Linda Hamilton', 50)
//From here it can not be modified
    let movieOne = new Movie("Kong","2018","2h30m");
    let movieTwo = new Movie("Joker","2019","2h03m");
    let movieThree = new Movie("John Wick 3", "2019", "1h49m");
//To here it can not be modified

See? Arnold should be in the actors too but it isnt! Thanks for the help in advance.

Another thing, this is for an excercise and i can not modify the lines i commented.

13 thoughts on “Class object overlapping”