ES6 - Use Destructuring Assignment to Pass an Object as a Function's Parameters

Hi everyone, can someone tell what’s the mistake in my code? I’d appreciate it.

This is my code:

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

Object.freeze(myFullName);

let logMyFullName = ({firstName, _$SecondName, _La_st__na_me}) => {

return firstName + _$SecondName + _La_st__na_me;

};

And this is what’s the console send me:


TypeError: undefined is not an object (evaluating '_ref.firstName')

Challenge: ES6 - Use Destructuring Assignment to Pass an Object as a Function’s Parameters

Link to the challenge:

Hello!

Try using the const instead of let.

My lesson appears to be different for this one.

If yours is the same, I would guess that may also be an issue.

Happy coding! :slight_smile: