DEV Community

Jasterix
Jasterix

Posted on • Updated on

5 JavaScript core concepts you should understand

You might have heard JavaScript described as a single threaded, non-blocking, asynchronous, concurrent language. But did you know that JavaScript is also a high-level, garbage-collected, prototype-based, multi-paradigm, dynamic language?

As a new JavaScript developer, you don't need to know what these words mean in order to start building cool projects. But over time, understanding what JavaScript is will help with writing better code, as well as offer a better understanding of how code executes. Even several months in, I'm still constantly learning what some might call fundamental JavaScript concepts.

Also, I know these concepts are way more complex than the few lines I’m allotting to each. But one of the challenges I've faced is that most blogs don’t try to distill these topics into manageable chunks that beginners can perceive. So I am oversimplifying these topics because that is the point.

Consider this blog to be the first in a series of blogs exploring fundamental JavaScript concepts not addressed in the average tutorial. This first post will not touch on the JavaScript runtime environment, but the next one(s) will.

JavaScript Core Concepts

As stated earlier, JavaScript is also a high-level, garbage-collected, prototype-based, multi-paradigm, dynamic language. Now let's explore what each term means:

  1. High-level:

    • Level (vs. low-level) refers to the level of abstraction from the computer's type. While the code is more programmer-friendly to read and write, that code will need to be transformed into machine-readable code.
  2. Garbage-collected:

    • JavaScript has a background process to free up memory based on reachability. This is based on whether an object is referenced by or tied to any other object
  3. Prototype-based: (This explanation could be much better)

    • JavaScript is prototype-based, (rather than class-based). All JavaScript objects have a prototype that they can inherit methods from. So not only does your object you create have access to the methods you explicitly define, it will also have access to the properties of its prototype going back to the Object.prototype.
  4. Multi-paradigm:

    • While JavaScript is an object-oriented language in the sense it's based on objects with properties and methods, JavaScript supports both imperative and functional programming paradigms.
  5. Dynamic:

    • Dynamic refers to typing (e.g. number, string, boolean). Instead of specifying the type when you write the code and checking type at compilation, JavaScript does the type checking at runtime.

Before writing this post, it felt like I had a relative good grasp of these 5 concepts. But it was challenging to summarize them in a few sentences. But in researching for this post, I stumbled across this video on JavaScript inheritance. Nil did a great job tackling the topic in a relatively short video.

What did you think of my summary for each concept? If there's anything I got wrong or could explain better, please let me know. If there are any other concepts not on the list that consider core to growing as a developer, definitely let me know!

Top comments (17)

Collapse
 
garetmckinley profile image
Garet McKinley

Really nice list!

All JavaScript objects have a prototype that they can inherit methods from

This could definitely use some external links or a bit more clarification. What exactly does it mean to have a "prototype"? That sentence is assuming you know what the difference between class and prototype based languages. Just my two cents.

Collapse
 
jasterix profile image
Jasterix

That's a good point. I had a tough time explaining this point without rambling

Collapse
 
codefinity profile image
Manav Misra

The video link mentioned 👆🏽adds some context and clarification.

Collapse
 
rattlingshinuiba profile image
Rattlingshinuiba • Edited

Hello there. For Multi-paradigm in Javascript, shouldn't functional programming be replaced with declarative programming?

Functional one of course exists, but am I right to think it is better to contrast imperative with declarative programming?

edit: sorry! That's my fault. I just read through a article which states

functional programming is a subset of declarative programming.

Collapse
 
jasterix profile image
Jasterix • Edited

Thanks for commenting! I think it might be fun to explore what people mean by declarative or functional

Collapse
 
rattlingshinuiba profile image
Rattlingshinuiba • Edited

Thanks for replying. This article has explored the difference between imperative and declarative programming. The author also mentioned functional programming.

An idea flashes into my mind. I thought functional has something to do with to break something down to pieces with regards to programming principle. Instead, Functional is probably applied to the sense to work. It's kind of like "hey! It just works! Just don't care about details", which is a bit like declarative programming. This might sound silly, but I am not native English speaker so feel free to point out errors.

Collapse
 
mike_hasarms profile image
Mike Healy

I don't think a five year old is what you think ;)

Nice writeup.

Collapse
 
jasterix profile image
Jasterix

Thanks. I agree though that I could probably simplify these descriptions a bit more

Collapse
 
mike_hasarms profile image
Mike Healy

No, I think your descriptions are fine.

It's the trope of explaining technical topics to five year olds that doesn't make sense to me. They've only just learned what bees are, and they can't yet tie shoe laces, I don't think the finer points of JS are really on their radar.

Thread Thread
 
jasterix profile image
Jasterix

haha gotcha. My 6 yo niece is obsessed with Minecraft so JS doesn't seem to far off

Collapse
 
danielmwakanema profile image
Daniel Mwakanema

Not sure if it applies for beginners but knowing about the Event Loop is important.

Collapse
 
gmkumar08 profile image
Manoj Kumar

Best video that I've watched recently on Event Loop: youtube.com/watch?v=8aGhZQkoFbQ&t=...

Collapse
 
jasterix profile image
Jasterix

Such a great explainer vid. I've watched it at least 10 times and could watch it 10 times more. I was thinking of tackling the event loop next

Collapse
 
zsivm profile image
zsivm • Edited

Nice article. I just want to let you know, in your second paragraph, you are missing the word 'know' between: ' you don't need to what'. Also under 1. Highlight you wrote, code machine code.

Collapse
 
jasterix profile image
Jasterix

Great catch! Thanks :)

Collapse
 
llmdev profile image
Lucas Moura

I agree with Garet, maybe an external links would help, but keep it up these tips lists help many in the day to day.

Collapse
 
jasterix profile image
Jasterix

I usually try to include only 1 link with each post to avoid overwhelming beginners. But I think doing 1 link per concept would be a good idea