QUESTION

Text
Image

*JavaScript*
Define a method named orderOfAppearance() that takes the name of a role as an argument and returns that role's order of appearance. If the role is not found, the method returns 0. Ex: orderOfAppearance("Young Murph") returns 5. Hint: A method may access the object's properties using the keyword this. Ex: this.title accesses the object's title property. // Code will be tested with different roles and movies let movie $=\{$ title: "Interstellar", director: "Christopher Nolan", composer: "Hans Zimmer", roles: [// Roles are stored in order of appearance "Cooper", "Brand", "Murph", "Mann", "Young Murph" ],l orderofAppearance: function(role) \{ \} 3 ;

Thank you

Public Answer

GJMW4A The First Answerer