was going through your code, and thought you might want to know....
const refinedMovies = response?.data?.results.filter((movie) => {
return movie?.backdrop_path !== null || "" || undefined;
});
this can be shortened just by checking if its truthy like this
return movie?.backdrop_path
!== null || "" || undefined is not needed as truthy checks all those.
It's the TMDb API.
was going through your code, and thought you might want to know....
const refinedMovies = response?.data?.results.filter((movie) => {
return movie?.backdrop_path !== null || "" || undefined;
});
this can be shortened just by checking if its truthy like this
return movie?.backdrop_path
!== null || "" || undefined is not needed as truthy checks all those.
Your post has inspired me!
Thanks.
I haven't refactored my code in a long time and I'm sure I've written some janky, rookie code back then!