Comparison in Javascript
//There are many types of simple comparison where we shuld only focus for limited time
//ex-Equal,Greaterthan,Lessthan etc
// console.log("2">1);
// console.log("02">1);
// console.log(null > 0);
// console.log(null == 0);
// console.log(null >= 0);
//Avoid this type of comparison as much as possible
// === it compares the datatypes also
console.log("2" === 2);
//False because of different datatypes
//Summary
//Primitive
//7 tytpes-String,Number,Boolean,Null,undefined,Symbol,BigInt
//Reference (Non Primitive)
//Array, Objects, Function,
//+++++++++++++++++++++++++++++++++
//Memory
//Stack(Primitive), Heap(Non-Primitive)
Comments
Post a Comment