Day: March 7, 2024

JavaScript typeof

In JavaScript there are 5 different data types that can contain values: There are 6 types of objects: And 2 data types that cannot contain values: JavaScript typeof ============== typeof “John” // Returns “string” typeof 3.14 // Returns “number” typeof NaN // Returns “number” typeof false // Returns “boolean”

JavaScript Let

Variables declared with let have Block Scope Variables declared with let must be Declared before use Variables declared with let cannot be Redeclared in the same scope JavaScript Let ========== let x = 1; { let x = 2; document.getElementById(“d2”).innerHTML = x; } { let x = 3; document.getElementById(“d3”).innerHTML = x; } document.getElementById(“d1”).innerHTML = x;

Back To Top