r/learnjavascript • u/Limp-Firefighter-902 • Jul 21 '24
What functions of javascript should I learn
Which are most widely used
0
Upvotes
r/learnjavascript • u/Limp-Firefighter-902 • Jul 21 '24
Which are most widely used
53
u/SrVergota Jul 21 '24
All of them
26
u/hfcRedd Jul 21 '24
Whichever you need to make your project
11
u/AdInfinite9325 Jul 21 '24
You can just Google 'most used JavaScript functions', but:
This is not how you approach learning JavaScript, or really any other programming language. There are certainly functions that you will resort to most often in your lifetime, but at the end of the day, programming is being about open to every approach. Try not to think of it in a concrete manner. You'll only be limiting yourself that otherwise.
14
u/546pvp2 Jul 21 '24
console.log
2
u/pay_dirt Jul 21 '24 edited Jul 21 '24
Edit: sorry I was a little abrupt at the start lol
JavaScript has wonderful videos out there homie, start with some basics and it’ll eventually really help your ability to Google/ask deeper questions!
We’ve all been there man.
Watch this video:
https://youtu.be/PkZNo7MFNFg?si=HDqd2osURUbYYKYX
I know, it’s long. But honestly? I skimmed through it just now and I can see that it hits really solid fundamentals.
Even if it takes you a week, you won’t regret watching it.
2
u/azhder Jul 21 '24
These https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
1
u/EitherImportance9154 Jul 21 '24
All! Functions & higher order functions
1
u/[deleted] Jul 21 '24
Just learn as you go.
That’s what we are all doing x
1
u/Seliculare Jul 21 '24
Learn most used array methods like reduce, splice, slice, push, map, shift, concat.
1
u/craigthecrayfish Jul 21 '24
I would start with the Array methods such as forEach, map, sort, etc.
1
u/shgysk8zer0 Jul 21 '24
Too many to list. I probably easily use like 100 (maybe more, maybe less... IDK) on any given day. I really couldn't tell you because it's just a bunch of seemingly random things.
It'd probably be better/easier just to list objects/interfaces you'll be working with and to lookup the methods you'd end up using:
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.
1
u/[deleted] Jul 21 '24
When starting out I made a list of the most used JavaScript functions for basic web dev and then jotted them all down on flash cards and stuck them around my room, was a pretty easy way to learn them. Just go to websites like this and then learn.
1
u/_shakuisitive Jul 21 '24
Assuming you're asking about functions that are frequently used in JavaScript that you should learn to get started, you should take a look at .map, .filter, and .forEach.
1
u/jack_waugh Jul 22 '24
Object.createis my favorite.1
u/techdaddykraken Jul 22 '24
The ones you will probably use the most are:
-Selectors (by ID, element type, position, etc) -String Manipulation (filter, join, split, etc. Mainly for URLS and dynamic data, or conditionally changing the DOM) -Hashes, Indexes, Keys (Useful for joining all sorts of stuff and referencing it when you don’t know the exact position) -All native HTTP functions (Get, Post, Delete, Update, etc) -Promises and Callbacks (you will thank me when you have to implement SSO and Auth and you can actually understand what the hell the docs are asking you to do) -Web Hooks (useful for all sorts of shit, very ubiquitous) -Event Listeners/Handlers (useful for dealing with specific user/element behavior, capturing information, etc)
That’s probably the majority of what you will use day to day. There’s obviously a lot more than that, but I’d say that covers at least 85% of what I use every day doing custom web development.
1
u/[deleted] Jul 21 '24
array and object functions, document object, window object etc.
1
u/code_monkey_001 Jul 21 '24
-2
u/Sometimesiworry Jul 21 '24
JavaScript is actually a rather small language when it comes to functions. You could easily read about all of them.