im trying to access an object with the following structure:
_res:{ merchant_1: value, merchant_2: value, merchant_3: value,}
What i want is to be able to plug a for loop index value as follow to get each property like : "merchant_1", "merchant_2"...:
for (let j = 0; j < 9; j++) {
if (_res.merchant_ + `%j` != null) {
var merchantName = _res.merchant_ + `%j`;
var arbitrageVal = parseFloat(p_amz - price).toFixed(2);
setRowsSub((prevRows) => [
...prevRows,
createData(merchantName, availability, price, arbitrageVal, 'jesus')
]);
} else {
j = 9;
}
}