The Property Hunter

Medium+20 XP

Mission Briefing

The ancient grimoire holds many secrets, but we only need to extract its title to catalog it! Don't carry the whole book object around, just yank out what you need.

The Concept: Destructuring

Object Destructuring lets you extract properties right into variables using curly braces! The variable name must perfectly match the object's property name. Example: const { name } = { name: "JS", level: 1 };

The Objective

Your function receives a book object.

  1. Extract the exact title property from the book object using object destructuring.
  2. Return that extracted title string alone.

01EXAMPLE 1

Inputbook = { title: "JS30", author: "Dev" }
Output"JS30"

Constraints

  • Use object destructuring { title } = book.
CoreES6+
JavaScript
Loading...
3 Hidden

Input Arguments

book{"title":"JS30","author":"Dev"}

Expected Output

JS30

Click RUN to test your solution