Concise Object Literal Declarations Codepen behavior w strict

Tell us what’s happening:
guys explain to me the following behavior the code I have attached is ok to pass fcc tests however if run on codepen will return ‘undefined’ (open up browser console for proof) and it only works if you replace:

const createPerson = (name, age, gender) => {
"use strict";
({name, age, gender });
};

With the below code:

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

Your code so far


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 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 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

You’ve missed a return, it doesn’t work because the function isn’t returning anything.