Javascript Weird Parts Instant

console.log(NaN === NaN); // false Yes, NaN is not equal to itself. You must use Number.isNaN() instead. This is the gateway drug of JS weirdness.

function show() { console.log(this); } show(); // window (or global in Node) new show(); // {} (the new instance) javascript weird parts

Let’s pop the hood and explore the —the quirks that make you scratch your head, and ultimately, make you a better developer. 1. typeof NaN === "number" (Excuse me?) You try to parse an integer from a string like "hello" . You get NaN (Not-a-Number). You ask JavaScript what type it is: console

Arrow functions don't have their own this —they inherit from the parent scope. That’s often a lifesaver, but it’s another thing to memorize. Every value in JS is inherently truthy or falsy. There are exactly 8 falsy values : function show() { console

JavaScript is the most misunderstood language in the world. Some call it broken; others call it beautiful. The truth? It’s both.

Both get converted to strings and concatenated. Not an error. Not useful. Just... weird. JavaScript’s weird parts aren’t bugs—they’re historical artifacts. Brendan Eich built this language in 10 days in 1995. It had to be flexible, forgiving, and fast.