Given a function:
function manipulateValidateReqRes (bearerToken) {
const res = validateExcelResponse.json().data
/* res value is:
{
"valid_data": [
{
"shipper_name": "automate sender",
"rts_reasons": [
"a reason"
],
"rts_score": 0
}
],
"shipping_rates": [
{
"reguler": {
"summary_price": "7.000",
"data": [
{
"_s": "9917",
}
]
}
}
],
"errors": [
[],
[]
]
}
*/
const manipulateRequest = res.map((obj, index) => {
return {
_s: res.data.shipping_rates[index].reguler.data[index]._s
}
}
}
why i cant return _s from map res.map function? it says TypeError: Object has no member ‘map’