r/learnjavascript • • Jul 27 '26

what's one JavaScript mistake every beginner should avoid?

If you could give one piece of advice to someone learning JavaScript today, what would it be?

It could be about:

  • Learning fundamentals
  • Debugging
  • Async code
  • DOM manipulation
  • Functions
  • Projects

Curious to hear what experienced developers wish they'd known earlier.

83 Upvotes

35 comments sorted by

View all comments

Show parent comment

1

u/regardedMAGAfascist Jul 27 '26

this is totally fine when you're actually using OOP (which you should be using). It's dead clear what's happening. Beyond that, avoid this like the plague.

class SomeClass {
  constructor(someProp = "someDefaultValue") {
    this.someProp = someProp
  }
}

const myClassInstance = new SomeClass("a value");

1

u/remain-beige Jul 28 '26

Fair response, I was thinking in terms of beginner advice though and OOP is a different paradigm and more of a developmental approach/choice than just normal procedural JS.