Js The Weird Parts May 2026
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?”
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. js the weird parts
Welcome to the weird parts. Let’s start with the most infamous party trick. If you’ve spent more than five minutes writing
const obj = { showThis: showThis }; obj.showThis(); // obj // obj const bound = showThis.bind("hello")
const bound = showThis.bind("hello"); bound(); // String {"hello"}
function showThis() { console.log(this); } showThis(); // window (or undefined in strict mode)