Someone has an idea how to reduce this code, maybe somehow using destructuring, but I didn't find any information about it.
response.orderQty.currentValue = currentInventory.orderValue
response.shipmentPrice.currentValue = currentInventory.shipmentPrice
response.itemsQty = currentInventory.itemsQty
response.statuses = currentInventory.statuses
response.countries = currentInventory.countries
I don't know if I fully understand the question, but you could put everything in an array and use Destructuring assignment like so:
but this could be counterproductive so I don't think I would use this way of assignment for these cases.
A better option but not yet considered the best way would be this
You could do any of the following:
Option 1
Option 2: