JavaScript
Hey, I have been working on Film Finder Project. When I log the json response of all the other functions I get what I want, however, when turning my face to the app’s functionality, I do not get any response.
const movieInfo = document.getElementById('movieInfo');
if (movieInfo.childNodes.length > 0) {
clearCurrentMovie();
};
try {
const movies = await getMovies();
const randomMovie = getRandomMovie(movies);
const info = await getMovieInfo(randomMovie);
displayMovie(info);
} catch(error) {
console.log(error);
}
};
And this gets logged to my console
TypeError: Cannot read properties of undefined (reading 'length') at getRandomMovie (helpers.js:76:59) at HTMLButtonElement.showRandomMovie (script.js:65:25)