Js The Weird Parts May 2026

console.log(0 == false); // true console.log("" == false); // true console.log(null == undefined); // true console.log(NaN == NaN); // false (yes, NaN is not equal to itself) The rule is simple: . It compares both value and type. The == operator tries to be "helpful" by converting types behind your back. That "help" is the source of countless bugs. NaN : The Loneliest Number Speaking of NaN (Not a Number), it has a personality disorder.

You are not alone. JavaScript is the quirky, misunderstood genius of the programming world. It was built in 10 days, it drives the modern web, and it has a list of "features" that look more like bugs. js the weird parts

And arrow functions? They don’t have their own this at all—they inherit from the surrounding scope. Arrays in JS are just objects with numeric keys and a special length property. That means you can do... questionable things. console

It gets weirder:

If you’ve spent more than five minutes writing JavaScript, you’ve probably had a moment where you stared at your screen and whispered, “...why?” That "help" is the source of countless bugs

console.log(1 + "1"); // "11" (string) console.log(1 - "1"); // 0 (number) Why? Because + is overloaded. If either operand is a string, it prefers string concatenation. But - doesn’t have a string version, so it coerces everything to numbers. Fun, right?

fill out this form to get started >>

Take the first step towards getting the results that you want!

By providing your phone number, you agree to receive text messages from Two Six Fitness