#100DaysOfCodeChallenge

Day 12: Javascript for People Who Think They’re Bad at It

If JavaScript has ever made you feel like you’re bad at coding, you’re not alone. It’s a weird language—quirky, unpredictable, and honestly a little dramatic. But the thing is, it’s not you. JavaScript just takes time to get used to.

Take == vs. ===, for example. Why does "5" == 5 work, but "5" === 5 doesn’t? The first one just checks if the values are kind of the same (ignoring types), while the second one checks everything, including type. So, always stick to === unless you want surprises.

Or how about this? It changes depending on how a function is called, which is why something like this breaks:

const person = {
  name: "Sara",
  greet: function () {
    console.log(this.name);
  },
};
const greet = person.greet;
greet(); // undefined

When you call greet() on its own, it has no clue what this should point to. Annoying, right?

And don’t even get me started on async code. If you’re still writing something like:

const data = fetch("https://api.example.com");
console.log(data);

And wondering why it doesn’t work, remember: JavaScript doesn’t wait for fetch() to finish. You need to use await (and maybe try...catch so it doesn’t explode on errors).

Here’s the thing: JavaScript isn’t something you “master” overnight. It’s more like an unpredictable roommate—you learn to live with it, quirks and all.

100daysofcode lebanon-mug

1 Like