ES6 - Use Destructuring Assignment to Assign Variables from Objects

Hello everyone, my code couldn’t run in the console, it shows that there’s an error(not syntax), if anyone can help me to find my mistake then i appreciate it, and thanks

This is the code;

let myFullName = {firstName: "Bushra",_$SecondName: "Abdulsalam", _La_st__na_me: "Ghames"};

Object.freeze(myFullName);

let myFirstName = myFullName.firstName;

const mySecondName = myFullName._$SecondName;

const myLastName = myFullName._La_st__na_me;


let {firstName: myFirstName,  _$SecondName: mySecondName,  _La_st__na_me: myLastName } = myFullName;

console.log(myFullName); 

**Your browser information:
Link to the challenge:

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.