Challenge: Extract Data with Object Destructuring
Task
Create a script demonstrating object destructuring by extracting properties from the provided movie
object and logging them. Specifically, construct a logging message that includes the person's name, producer, budget, and duration time.
const movie = { name: "Going in Style", producer: "Donald De Line", duration: 96, budget: "$25 million", }; // Destructure properties from the `movie` object const { ___, ___, ___, ___ } = movie; // Use the extracted properties console.log(`Name: ${___}`); // Movie name console.log(`Producer: ${___}`); // Movie producer console.log(`Duration: ${___} minutes`); // Movie duration time console.log(`Budget: ${___}`); // Movie budget
Expected output:
Name: Going in StyleProducer: Donald De LineDuration: 96 minutesBudget: $25 million
Obrigado pelo seu feedback!