On this page
Common technical mistakes
⚖️== instead of ===Loose comparison leads to unexpected behavior because of type coercion.
🔄A missing return in a functionA function without return always returns undefined, even if it computes something internally.
📦Mutating an array instead of copying itMethods like sort() and splice() change the original array instead of creating a new one.
🌀Confusion around this in regular functionsThe value of this depends on how a function is called, not where it was defined.
How to cut down on these mistakes
- Use === instead of == almost always, unless you have a clear reason not to.
- Check whether a function actually returns something if you're expecting a result from it.
- Check the docs to see whether a method mutates the original array/object or creates a new one.
- Prefer arrow functions for new code unless you specifically need your own this.
Why these mistakes are a normal part of learning
Every developer runs into these same mistakes early on — it's not a sign of lacking ability, it's a natural part of getting familiar with the language's quirks. Over time they turn into intuition that helps you catch similar problems before you even run the code.
Frequently Asked Questions
What's the most common mistake among beginners?
Confusing == and === — one of the most widespread, because the visual difference is minimal but the behavior differs noticeably.
How do I learn to spot these mistakes faster?
Regular practice and reading other people's code help build that intuition faster than theory alone.
What's next
Learn these subtleties from the very start
The JavaScript course specifically covers common pitfalls in the language, so you don't have to learn them the hard way alone.