I Initialize the empty variables first
let a = "";
let b = "";
let c = "";
Then call the api and after getting data assign the values from api response to the variables. If not getting any data then this will be empty.
suppose dataArray is the array where I am getting the response.
So, what I have done is:
dataArray = dataArray.map((x) => {
a = x.valueA;
b = x.valueB;
c = x.valueC;
});
Everything is fine on my response and code but when I check through ESLINT it return the error that is Use object destructuring
Is there anyone who help me to fix out this things. Any support is really appreciated