LearnFrenzy
Sign in Take a free test

Destructuring · Destructuring MCQ · Question 3

Renaming syntax Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 3 Back to Exercise

What does const { name: fullName } = user; do?

  • A Creates a variable name holding user.fullName
  • B Creates both name and fullName
  • C Sets user.fullName to user.name
  • D Creates a variable fullName holding user.name Correct
Correct Answer: Option D

In an object pattern the left side is the property to read and the right side is the variable to create.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links