这个的使用似乎总是让我感到困惑。如以下源代码所示。谁能解释一下语句 const {tz, msg} = this.state; 在下面的代码中是什么意思?
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
currentTime: null, msg: 'now', tz: 'PST'
}
}
getApiUrl() {
**const {tz, msg} = this.state;**
const host = 'https://andthetimeis.com';
return host + '/' + tz + '/' + msg + '.json';
}
export default App;