The use of this seems always confusing to me. As in the below source code. Can anyone explain what does the statement const {tz, msg} = this.state; mean in the below code?
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;