React 入门
React ES6 箭头函数
React ES6 变量
React ES6 数组方法
React ES6 解构
React ES6 扩展
React ES6 三元运算符
React JSX
React 组件
React 属性
React 事件
React 条件
React 列表
React 钩子 useState
React 钩子 useEffect
React CSS 样式

Menu
×
×
正确

练习:

使用解构来提取只有人的状态。

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 + '.'; }

不正确

点击 此处 重试

正确

下一题 ❯
const person = {
  name: 'Jesse',
  age: 30, 
  address: {
    city: 'Houston',
    state: 'Texas',
    country: 'USA'
  }
}

displayMessage(person)

function displayMessage({  }) {
  const message = 'I live in ' + state + '.';
}







×

重置分数?