Javascript Weird Parts Now

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

The eval() function can pose a security risk if not used properly.

console.log(add(2, 3)); // 5 function add(a, b) { return a + b; } javascript weird parts

If you’ve spent more than 48 hours with JavaScript, you’ve probably uttered the phrase: “Wait… why did it do that?”

Both get converted to strings and concatenated. Not an error. Not useful. Just... weird. JavaScript is the most misunderstood language in the world

The arguments object in JavaScript functions can be confusing.

console.log(NaN === NaN); // false

Floating-point math. JavaScript uses binary floating point; 0.1 in binary is a repeating fraction (like 1/3 in decimal). It can't be represented exactly.

The with statement can lead to unexpected behavior and is generally discouraged. It’s both

JavaScript defines weird type coercion rules for + .