Link Search Menu Expand Document

Write Concise Object Literal Declarations Using Object Property Shorthand

Summary

  • Object literals can be used to prevent to use of redundant variables.

Final Code

const createPerson = (name, age, gender) => {
  // Only change code below this line

  return {
    name,
    age,
    gender,
  };
  
  // Only change code above this line
};