Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

jump to level 1 define a setter function named wonaward () that takes a…

Question

jump to level 1
define a setter function named wonaward () that takes a parameter for the name of an award and pushes the award name onto the end of the awards array.
1 // code will be tested with a different movie
2 let movie = {
3 title: \forrest gump\,
4 director:
obert zemeckis\,
5 composer: \alan silvestri\,
6 budget: 55000000,
7 boxoffice: 677900000,
8 awards: ,
9
10 / your solution goes here /
11
12 };

Explanation:

Step1: Define the setter function

movie.wonAward = function(awardName) {

Step2: Push the award name to the awards array

    this.awards.push(awardName);
};

Answer:

movie.wonAward = function(awardName) {
    this.awards.push(awardName);
};