Hello ma'am it's an informative video thanks for it , by the way what editor or extension is that which gave that warning : x is not defined. in red color 😁
As First console will print the undefiend because the declaration of x hoisted to the top and the fact that var is variable are not blocked scope and after hoisting its value initalize as 2 and in the inner block let x = 5 as we know let are block scope as the block end x =5 terminate and so the next console will print the x = 2 which is intialize in the outer block Please correct if i am wrong thank you so much 😊