2min chapter

Syntax - Tasty Web Development Treats cover image

Code Styles: Readable Rules and Petty Preferences

Syntax - Tasty Web Development Treats

CHAPTER

Should I Use Multiple Map Filter Reduce Functions and Just Chain Them All Together?

I love reduce and I will use reduce where it makes sense. But if there is obviously another function that does something like that because JavaScript is adding new array methods all the time, then clearly use that. And I often opt for doing multiple map filter reduce chains. I find them a little bit more readable over doing it all in one go on reduce. If I'm looping over 300,000 database records and trying to figure out how many blue cars have been sold, then of course that's probably a really good use for reduce. In most cases, it probably doesn't matter.

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode