Menu

Modern JavaScript: Variables, Functions and Objects
πŸ“°

Modern JavaScript: Variables, Functions and Objects

DEV Community: nodeΒ·Javi PalaciosΒ·about 13 hours ago
#qpgj0OXb
#devtonodejs#devto#dev#name#enter
Reading 0:00
15s threshold

All JavaScript looks the same, and a good chunk of it is wrong. Not broken β€” dated. Code written in 2012 and pasted into 2026, full of underscores, callbacks and var everywhere, like a family recipe nobody has updated and everybody keeps cooking.

You're going to read a lot of it, so it pays to know what's dated and what isn't. There's a better reason too: almost everything in JavaScript that looks arbitrary has a specific explanation behind it. const that isn't constant. this that changes with the way you call. class that isn't a class. Every one of those oddities is a design decision, and until you see it, the language looks like it was written by someone in a hurry.

It was. But it's consistent.

const , let , and the var you no longer need

Two ways to declare a variable, plus a third that survives on inertia.

const name = "Ada" ; let counter = 0 ; counter ++ ;

console .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.