Javascript Weird Parts [new] -

const arr = [1, 2, 3]; const obj = { a: 1 }; console.log(arr + arr); // "1,2,31,2,3" (string) console.log(arr + obj); // "1,2,3[object Object]"

JavaScript is the most misunderstood language in the world. Some call it broken; others call it beautiful. The truth? It’s both. 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: const arr = [1, 2, 3]; const obj = { a: 1 }; console