DEV Community

Cover image for 10 JavaScript concepts every Node developer must master

10 JavaScript concepts every Node developer must master

USMAN AWAN on October 05, 2024

Node.js has quickly become a standard for building web apps and systems software, thanks to its ability to leverage JavaScript on the back end. Pop...
Collapse
 
serhiyandryeyev profile image
Serhiy

but why do you use var?

Collapse
 
wormss profile image
WORMSS

I am guessing someone who likes the nasty habit of hoisting. I would put money on them not being fans of Typescript.
I don't mind function hoisting, but I don't know of anyone who likes variable hoisting.
Though, I find people who use let for absolutely everything to be strange also.. I use const for everything unless I absolutely HAVE to use a reassigning variable, which is maybe only 1% of the time at most.

Collapse
 
jonathands profile image
Jonathan DS

Is it hoisting or just global scope?

Thread Thread
 
wormss profile image
WORMSS

Hoisting. Because if you are inside another scope (closure for example) it's no longer globally available.

Collapse
 
mino profile image
minoblue • Edited

One usecase is when we want to access variable outside the block within the function.

function example() {
  if (true) {
    var x = 10;  // 'var' is function-scoped, not block-scoped
    let y = 20; // 'let' is block-scoped
  }
  console.log(x); // Accessing 'x' outside the 'if' block
  console.log(y); // ReferenceError: y is not defined
}


Enter fullscreen mode Exit fullscreen mode
Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Good points to remember in JS. I really enjoyed reading it.

Collapse
 
usman_awan profile image
USMAN AWAN

Thank you very much 😊

Collapse
 
shield8994 profile image
shield8994

Your article is well written. I am the operator of servbay. Can you promote our products? Our official website is servbay.com. If you are willing, we can give you some channel discounts.

Collapse
 
usman_awan profile image
USMAN AWAN

I would be an honour 😊😋

Collapse
 
shield8994 profile image
shield8994

How can I contact you? Email?

Thread Thread
Collapse
 
abid_official profile image
Abid

Hi, is it not for windows users? I can not find any link for windows on your website.

Collapse
 
georgius1024 profile image
Yurii Timofeev

Good advice... for 2014

Collapse
 
bradtaniguchi profile image
Brad

I gotta point it out.

It seems like the code examples have inconsistent indentation? 🤔

Collapse
 
mshossain110 profile image
Shahadat Hossain

Javascript and Node becoming more popular among developers. it is not bind only for web applications; we are building more complex applications like IOT, machine learning, chatbots, ect.
it is a really game changer for developer.

Collapse
 
fridaycandours profile image
Friday candour

It's for beginners

Collapse
 
wormss profile image
WORMSS

Technically it's for 'everyone'.
Beginners will be learning about it, and for advanced people, it's a checkbox exercise to say "yep, I know these concepts".. It's not like, once you are past the beginners stage, you can forget these concepts..
It's always good to remember that async/await is sugar for Promises/then, and class declarations is sugar for prototype. It's good to remember that these are what is happening under the hood. Even if you don't touch these old ways anymore.

Collapse
 
mohammad_zeeshan_5d369f7b profile image
Mohammad Zeeshan

Absolutely agree! Understanding these concepts are the backbone of JavaScript and serve as a reminder of what’s happening under the hood. Even if advanced devs rarely use the 'old ways,' knowing them enhances debugging, performance optimization, and deepens overall JavaScript expertise. For beginners, it's a foundation to build on. Revisiting these basics is always worthwhile—it ensures we don’t just write code but truly understand how it works at its core.

Collapse
 
snrmwg profile image
Marc

advanced beginners ;-)

Collapse
 
asostomp profile image
Tom Pereira

Shouldn't:

the CommonJS include syntax and the ES6 require syntax.

...read:

the CommonJS require syntax and the ES6 include syntax.

Collapse
 
william_bernfield_0bd0153 profile image
William Bernfield

Hello everyone, id live to get some help, Also how do you all feel about Quantum capabilities ? Early access

Collapse
 
almogzur profile image
almogzur

Vary nice

Collapse
 
arsalannury profile image
ArsalanNury • Edited

Thanks, I haven't seen anyone use IIFE in real programs. I think just Webpack and Babel are use it :-))))

I find rest operators the most useful section in this article my friend

Collapse
 
webjose profile image
José Pablo Ramírez Vargas

UMD modules are basically IIFE's. AngularJS had heavy use of IIFE's. Finally, CommonJS can see them used to encapsulate await syntax.

Collapse
 
alexander_borshak_cdf858e profile image
Alexander Borshak

Did you ever use jQuery? Aside of it, IIFE used often when you have to perform some actions during init stage of ESM module.

Collapse
 
command_string profile image
Robert Snedeker

Great article! I recently discovered the # private property/method thing in JS. But now that I use TS it's not something I use, still cool to see that JS is getting more OOP features though.

Collapse
 
killer_space_db079fe14a69 profile image
killer space

broo ,really this is way advanced for a beginner in js

Collapse
 
usman_awan profile image
USMAN AWAN

😊

Collapse
 
raguram90 profile image
RamR

nice post

Collapse
 
softwaredevelopmentinsights profile image
Softwaredevelopmentinsights

Great insights on JS. It is very informative.

Collapse
 
raulpenate profile image
The Eagle 🦅

I've had fun reading this article, thanks bro!

Collapse
 
rafarios profile image
Rafa Rios

Nice article to bear in mind. Thanks for the clear examples

Collapse
 
sachin_kotian_b225f65d77f profile image
sachin kotian

nice article but try pasting code instead of screenshots

Collapse
 
dsabalete profile image
David Sabalete

Thank you!

Collapse
 
retrop5 profile image
retrop5

The first I learnt / heard of curry functions and I love it, I am gonna keep using it extensively moving forward

Collapse
 
axorax profile image
Axorax

cool article :D

Collapse
 
vivekk101 profile image
Vivek Garg

Love these insights keep sharing such valuable thoughts.

Collapse
 
adexh profile image
Adesh Tamrakar

This is going to be my everytime go-to revision list. Thanks.

Collapse
 
usman_awan profile image
USMAN AWAN

Glad to hear it 😊

Collapse
 
ynevet profile image
Yair Nevet

Great post! However, it's a shame that the code examples are presented as images instead of regular text, as it makes it harder for readers to copy and test the code themselves.