10 JavaScript Interesting Questions, Output & Explanation.
welcome
hello
var
is function scoped, therefore, when msg
is declared inside the if
block, it overrides the msg
in the global scope. This does not happen with let
as it is block scoped.
#interview-questions #javascript #web-development #programming #developer