Tell us what’s happening:
I wrote the code in 3 ways (little modifications) and passed the test in every ways. It is creating confusion for me. which is the right way to solution? @PortableStick
Your code so far
**1**
const createPerson = (name, age, gender) => {
"use strict";
// change code below this line
name, age, gender
// change code above this line
};
console.log(createPerson("Zodiac Hasbro", 56, "male")); // returns a proper object
**2**
const createPerson = (name, age, gender) => {
"use strict";
// change code below this line
{name, age, gender};
// change code above this line
};
console.log(createPerson("Zodiac Hasbro", 56, "male")); // returns a proper object
**3**
const createPerson = (name, age, gender) => {
"use strict";
// change code below this line
({name, age, gender});
// change code above this line
};
console.log(createPerson("Zodiac Hasbro", 56, "male")); // returns a proper object
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/write-concise-object-literal-declarations-using-simple-fields