Runtime Error
Здравейте. Задачата работи във VScode, но джъдж ми дава Runtime Error. forEach is not a function?!?!
Каква е причината за този ерор?
Задачата е Flight Schedule от JavaScript Fundamentals More Exercise.
Моят код:
```
function flightSchedule(array) {
let flights = {};
array[0].forEach((line) => {
let [flightNumber, destination] = line.split(" ");
flights[flightNumber] = {
Destination: destination,
Status: "Ready to fly",
};
});
array[1].forEach((line) => {
let [flightNumber, status] = line.split(" ");
if (flights.hasOwnProperty(flightNumber)) {
flights[flightNumber].Status = status;
}
});
for (let flight in flights) {
if (flights[flight].Status === String(array[2])) {
console.log(flights[flight]);
}
}
}
```