freeCodeCamp/guide/chinese/certifications/javascript-algorithms-and-d.../es6/write-concise-object-litera.../index.md

576 B
Raw Blame History

title localeTitle
Write Concise Object Literal Declarations Using Simple Fields 使用简单字段编写简明对象文字声明

使用简单字段编写简明对象文字声明

在这里,我们的任务是返回一个接受函数参数作为其属性的对象。

提示1

摆脱冒号和重复的单词。

扰流警报 - 提前解决

const createPerson = (name, age, gender) => { 
  "use strict"; 
  // change code below this line 
  return { 
    name, 
    age, 
    gender 
  }; 
  // change code above this line 
 };