So, I have this here function designed to split the array elements and return them to two separate arrays. Problem is, when I try yo run it it returns "Challenges.js:32 Uncaught TypeError: Cannot read properties of undefined (reading 'split')" I don't really get it, what am I missing here? Sorry for the noob question, been studying for less than two weeks :D
const array0 = [
"3:1",
...
"4:0",
];
let array1 = [];
let array2 = [];
for (let i = 0; i <= array0.length; i++) {
array1.push(array0[i].split(":")[0]);
array2.push(array0[i].split(":")[1]);
}
console.log(array1, array2);