Posts

Showing posts from March, 2025

JS - Note

Image
Variable-     typeof-    typeof undefined- is undefined  let car;  then = typeof car is undefined Equal and Strict equal-  let objOne = { name: "Smith" }; let objTwo = { name: "Smith" }; console.log(objOne === objTwo);  // output false , also false in equal operator (as the onjects are stored in different locations) null==undefined-> true    String Interpolation calculation inside template-string(  ${}) - example- ${firstNumber * secondNumber} Undefined & Null- let x; console.log(x) - gives Undefined const x; console.log(x) - gives Syntax Error Null and Undefined difference-  When a variable is  undefined , it means it has been given no value to hold. Whereas, when a variable is  null , it means the variable has a value, the value  null . OBJECT -    to get keys- Object.keys(objName)- returns array to get values - Object.values(objName)- returns array to get both as array format- Object.entries(...