1.1 KiB
1.1 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d7b8a367417b2b2512b4f | Write Concise Object Literal Declarations Using Simple Fields | 1 |
Description
undefined
Instructions
undefined
Tests
tests:
- text: ''
testString: 'assert(() => {const res={name:"Zodiac Hasbro",age:56,gender:"male"}; const person=createPerson("Zodiac Hasbro", 56, "male"); return Object.keys(person).every(k => person[k] === res[k]);}, "the output is <code>{name: "Zodiac Hasbro", age: 56, gender: "male"}</code>.");'
- text: ''
testString: 'getUserInput => assert(!getUserInput("index").match(/:/g), "No <code>:</code> were used.");'
Challenge Seed
const createPerson = (name, age, gender) => {
"use strict";
// change code below this line
return {
name: name,
age: age,
gender: gender
};
// change code above this line
};
console.log(createPerson("Zodiac Hasbro", 56, "male")); // returns a proper object
Solution
// solution required