I had this code:
const availableDays = status.availableDays;
And I had a suggestion to change with:
const { availableDays } = status;
They both are one line code, but I wonder if there is an explanation on why would be the destructuring a better way to code than the first one.
If the code would be:
const availableDays = status.availableDays;
const someVar = status.someVar;
const someOtherVar = status.someOtherVar;
I know that would be shortest (don't know if better) this way:
const { availableDays, someVar, someOtherVar } = status;
But my question goes to a performance, security, readability, etc reason.