FCC - ES6 - Object Literals - Declaration
by vanduzled
JavaScript
const createPerson = (name, age, gender) => {
// Only change code below this line
return {
name,
age,
gender
};
// Only change code above this line
};
//Write Concise Declarative Function
// Only change code below this line
const bicycle = {
gear: 2,
setGear(newGear) {
this.gear = newGear;
}
};
// Only change code above this line
bicycle.setGear(3);
console.log(bicycle.gear);
//3