Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Output the sentence Number of actors: followed by the number of actors. Then use a loop to output Actor: { name } , Role:

Output the sentence "Number of actors: " followed by the number of actors. Then use a loop to output "Actor: {name}, Role: {role}" for each actor.Output the sentence "Number of actors: " followed by the number of actors. Then use a loop to output "Actor:
{name}, Role: {role}" for each actor.
/* Ex: Given the following actors map, output should be:
Number of actors: 2
Actor: Elijah Wood, Role: Frodo Baggins
Actor: Orlando Bloom, Role: Will Turner */
let actors = new Map(); // Code will be tested with different actors
actors.set("Elijah Wood", { movie: "The Lord of the Rings", role: "Frodo Baggins" });
actors.set("Orlando Bloom", { movie: "Pirates of the Caribbean", role: "Will Turner" });
console. "Number of actors: "+ actors.size);
for (let [name, details] of actors){
}
console. Actor: actors}}, Role: details.role}');
\table[[1,2,3,4,5]]
Testing with 4 actors
Yours and expected differ. See highlights below. Special character legend
Number of actors: 4
Actor: ${actors}, Role: ${details.role}
Yours Actor: $ actors}, Role: ${details.role}
Actor: ${actors}, Role: ${details.role}
Actor: $ actors}, Role: ${details.role}
Number of actors: 4
Actor: Elijah Wood, Role: Frodo Baggins
Expected
Actor: Matthew McConaughey, Role: Cooper
Actor: Orlando Bloom, Role: will Turner
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago