ES6 - Write Concise Object Literal Declarations Using Object Property Shorthand

Tell us what’s happening:
Hello !
I don’t understand why you placed theses two commentaries
Then we have a return keyword which isn’t needed in the code.

Without theses commentary, we can write the code this way.

const createPerson = (name, age, gender) => ({
name,age,gender

});

  **Your code so far**
const createPerson = (name, age, gender) => {
// Only change code below this line
return {
  name: name,
  age: age,
  gender: gender
};
// Only change code above this line
};
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Challenge: ES6 - Write Concise Object Literal Declarations Using Object Property Shorthand

Link to the challenge:

Hey!
Do you have any questions? if so, you should describe them in the “Describe your issue in detail here” section so its easier for others to help you.

1 Like

The code between those two comments need to be changed to fulfill this test:

Your code should not use key:value .

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