JS
challenger
Home
JavaScript Basics
objects
Add a Property Based on Two Existing Properties
Add a Property Based on Two Existing Properties
Given an object with 'firstName' and 'lastName' properties, add a new property called 'fullName' whose value is the two properties joined with a space.
reset
const person = { firstName: 'Ada', lastName: 'Lovelace' }; // Add a 'fullName' property below, combining firstName and lastName
console.log(person.fullName); // expected: "Ada Lovelace"
JavaScript
Run Code
Console