Menu
×
×
Correct!
Exercise:Use destructuring to extract only the person's state.
const person = {
name: 'Jesse',
age: 30,
address: {
city: 'Houston',
state: 'Texas',
country: 'USA'
}
}
displayMessage(person)
function displayMessage({ @(18) }) {
const message = 'I live in ' + state + '.';
}
const person = {
name: 'Jesse',
age: 30,
address: {
city: 'Houston',
state: 'Texas',
country: 'USA'
}
}
displayMessage(person)
function displayMessage({ address: { state } }) {
const message = 'I live in ' + state + '.';
}
const person = {
name: 'Jesse',
age: 30,
address: {
city: 'Houston',
state: 'Texas',
country: 'USA'
}
}
displayMessage(person)
function displayMessage({ address:{state} }) {
const message = 'I live in ' + state + '.';
}
const person = {
name: 'Jesse',
age: 30,
address: {
city: 'Houston',
state: 'Texas',
country: 'USA'
}
}
displayMessage(person)
function displayMessage({address:{state}}) {
const message = 'I live in ' + state + '.';
}
const person = {
name: 'Jesse',
age: 30,
address: {
city: 'Houston',
state: 'Texas',
country: 'USA'
}
}
displayMessage(person)
function displayMessage({address:{ state }}) {
const message = 'I live in ' + state + '.';
}
const person = {
name: 'Jesse',
age: 30,
address: {
city: 'Houston',
state: 'Texas',
country: 'USA'
}
}
displayMessage(person)
function displayMessage({address: {state}}) {
const message = 'I live in ' + state + '.';
}
Not CorrectClick here to try again. Correct!Next ❯ |
This will reset the score of ALL 24 exercises.
Are you sure you want to continue?