DEV Community

Discussion on: I landed my first dev job after 6 months of building projects. Here's my story!

Collapse
 
devcoder profile image
devcoder

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!

Thread Thread
 
prnvbirajdar profile image
Pranav Birajdar

Thanks.

I haven't refactored my code in a long time and I'm sure I've written some janky, rookie code back then!