for (index = 0; index <= data.length; ++index) {
console.log(data);
var BASKET_ID = data[index]['BASE_PRICE'];
}
выдает ошибку basket/?clear_cache=Y:2165 Uncaught TypeError: Cannot read properties of undefined (reading 'BASE_PRICE')
at Object.success (basket/?clear_cache=Y:2165:61)
at c (jquery-3.6.0.min.js:2:28327)
at Object.fireWith [as resolveWith] (jquery-3.6.0.min.js:2:29072)
at l (jquery-3.6.0.min.js:2:79901)
at XMLHttpRequest. (jquery-3.6.0.min.js:2:82355)
подскажите что не так ?
for (index = 0; index <= data.length; ++index) {
console.log(data[index]['BASKET_ID']);
}
без присвоения переменной
338466
338467
338468
Uncaught TypeError: Cannot read properties of undefined (reading 'BASKET_ID')
at Object.success (basket/?clear_cache=Y:2164:56)
at c (jquery-3.6.0.min.js:2:28327)
at Object.fireWith [as resolveWith] (jquery-3.6.0.min.js:2:29072)
at l (jquery-3.6.0.min.js:2:79901)
at XMLHttpRequest. (jquery-3.6.0.min.js:2:82355)