I want to use object destructing for simplyfing my code. I am getting data from server and the resolve is object:
data = {
current: {
humidity: 73
}
}
Final function should looks like this, but this does not work:
extractData({data.current.humidity: humidity }) {
return { humidity };
}
extractData(data);
How to do function for this kind of object?