|
|
|
ISTool |
|
Js The Weird Parts Jun 2026: The default environment where your code begins (creates the window object and this ). console.log(1 + "1"); // "11" (string) console.log(1 - "1"); // 0 (number) js the weird parts It gets weirder: 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? : The default environment where your code begins Arrays in JS are just objects with numeric keys and a special length property. That means you can do... questionable things. // "11" (string) console.log(1 - "1") |
|
|||||||||||||||||
|
|
||||||||||||||||||