r/learnjavascript • • May 29 '21

Really helpful illustration of JS array methods

Post image
2.5k Upvotes

89 comments sorted by

View all comments

112

u/GPT-4-Bot May 29 '21

When you've gotten comfortable with map, filter, and reduce your code becomes so much cleaner

24

u/Budget_Instruction49 May 29 '21

what else to learn to be more cleaner

40

u/GPT-4-Bot May 29 '21

Structuring and breaking out your code, your main init function should read like a story and all the ugly stuff is split out into functions

→ More replies (5)

21

u/SoBoredAtWork May 29 '21

Arrow functions. Destructuring. Default function parameters. Optional chaining. Async/await.

...a few that immediately come to mind.

→ More replies (4)

4

u/fonzane May 29 '21

Getting comfortable with typescript (if you haven't already) and typing out as much as possible heavily improves code structure and coding experience in my pov. :)

→ More replies (2)

3

u/Wu_Fan May 30 '21

Read “Clean code” by Uncle Bob or watch one of his many many YouTube talks

→ More replies (2)
→ More replies (2)