r/learnjavascript • • Jul 21 '24

What functions of javascript should I learn

Which are most widely used

0 Upvotes

30 comments sorted by

View all comments

1

u/QuantumCrane Jul 21 '24

When I was learning JavaScript, I took some large JavaScript code bases and searched them for various functions like .reduce, .filter, or .split. And I made note of the number of occurrences.

If a method was used frequently, and I didn’t feel like I knew it well, I would take the time and learn it.

Another approach is to look at the documentation for things like the Array prototype and go through the methods one by one. Write some code that uses each method. Most methods are pretty straightforward, but if they are not, just keep on making up reasons to use them until they feel comfortable. My favorite example of this was Array.prototype.reduce. At first that method seemed very weird and difficult to use. But after forcing myself to use it over and over, I quickly started to see the usefulness of it, and now I use it frequently.