Find the data types by using - typeof
Interesting thing - type of null is object - historical
Explaining difference between null and undefined
Explaining the difference between Primitives and Object - For primitives like number, string, booleans, etc if we copy it first and then change the copied one, then original remains unchanged while for object, it is changed.
//Example of Primitive
let money1 = 5000;
let money2 = money1;
money2 = 2000;
console.log(money1);
console.log(money2);
//Example of object
const student1 = {name: "Ram"};
const student2 = student1;
student2.name = "Shyam";
console.log(student1);
console.log(student2);
if(age >= 16) {
console.log("You can drive");
} else {
console.log("You cannot drive");
}
What is truthy and falsy(0, “”, false, null, undefined, NaN,) value and using it in if else.
Task -