Answer:
var movie = {
// Code will be tested with different actors and movies
name: "Interstellar",
director: "Christopher Nolan",
composer: "Hans Zimmer",
cast: {
"Matthew McConaughey": "Cooper",
"Anne Hathaway": "Brand",
"Jessica Chastain": "Murph",
"Matt Damon": "Mann",
"Mackenzie Foy": "Young Murph"
},
roleOf: function (actorName) {
if (!(actorName in this.cast)) {
return "Not in this movie.";
}
return this.cast[actorName];
}
};
Explanation: