Tuesday, March 29, 2022

typeof

 Usage of typeof

1. The type of null is object.

2. Uninitialized variables have undefined as the type.

console.log(typeof 23);
console.log(typeof 3.14);
console.log(typeof "RK");
console.log(typeof true);
console.log(typeof null);

let a;
console.log(typeof a); //Undefined

let b = 18;
console.log(b, typeof b);



OUTPUT


No comments:

Post a Comment