Quirks

Hoisting

Even though JS code is interpreted from top, functions and var declarations are put on top of the file even if it is written in somewhere in the middle.

Note that only declarations are hoisted, not initializations.

console.log(x);

var x = 10;

Hoisted code looks like:

var x = undefined;

console.log(x);

x = 10;

So the logged output will be undefined not 10.

CS/Languages/JS/Type System#Type Systems Implicit Casting Implicit Type Coercion

© 2025 All rights reservedBuilt with Flowershow Cloud

Built with LogoFlowershow Cloud