let a;
console.log(typeof a);       // Output: "undefined"

console.log(typeof true);    // Output: "boolean"
console.log(typeof 42);      // Output: "number"
console.log(typeof "Hello"); // Output: "string"
typeof operand
let x = 42;
let y = "Hello";
let z = {key: "value"};

console.log(typeof x);  // Output: "number"
console.log(typeof y);  // Output: "string"
console.log(typeof z);  // Output: "object"
/* Numbers */
typeof 24 === "number"
typeof 3.14 === "number"
typeof NaN === "number"

typeof parseInt("10px") === "number"
typeof Number("2") === "number"  
typeof Number("text") === "number" 

/* Strings */
typeof "coding" === "string"
typeof "" === "string"
typeof `template literal` === "string"
typeof "24" === "string"
typeof String(24) === "string"

/* Booleans */
typeof true === "boolean"
typeof false === "boolean"
typeof Boolean(24) === "boolean"

typeof !!24 === "boolean" // Double negation (!!) converts value to Boolean

/* Undefined */
var x;
typeof x === "undefined";
typeof undefined === "undefined";

typeof y === "undefined"; // Returns "undefined" even for undeclared variables

/* Objects */
typeof {param: 1} === "object";
typeof {} === "object";

typeof [1, 2, 3] === "object"; // Arrays also return "object"
typeof [] === "object"; // Empty arrays also return "object"

typeof /regex/ === "object"; // Regular expressions return "object"

typeof null === "object" // null also returns "object"

/* Functions */
function $() {}
typeof $ === "function";

typeof function () {} === "function";
typeof class ClassName {} === "function";

/* Symbols */
typeof Symbol() === "symbol";
typeof Symbol("foo") === "symbol";

/* BigInts */
typeof 1n === "bigint";
typeof BigInt("1") === "bigint";
console.log(typeof null); // Output: "object"
let regex = /[a-zA-Z]/;
console.log(typeof regex); // Output: "object"
const arr = [1, 2, 3];
console.log(typeof arr); // Output: "object"
const arr = [1, 2, 3];
console.log(Array.isArray(arr)); // true
// Variable x has never been declared
console.log(typeof x); // "undefined"
/* Variable x has been declared but not assigned a value */
let x;

if (x === undefined) {
    console.log("Evaluates to true.");
} else {
    console.log("Evaluates to false.");
}
// Output: "Evaluates to true."

/* Variable y is undeclared */
try {
    y; // Attempt to access variable y
    console.log("Variable is declared.");
} catch (error) {
    console.log("Variable is not declared.");
}
// Output: "Variable is not declared."
if (typeof jQuery === "function") {
    console.log("jQuery is loaded and available.");
} else {
    console.log("jQuery is not loaded.");
}