@anadec5302
Nothing here yet.
Nothing here yet.
No blogs yet.
In the first picture stars is initialized and declared as "North Star" with let keyword. So with let keyword we can change the variable value whenever we want. So inside the "myNightSky" function you are changing the value of stars to "Sirius" as it is accessible to that function and it's affected globally as well. In second picture, the stars variable which you initialized and declared as "Sirius" inside the "myNightSky" function is completely engaged to the function itself, It is not accessible outside that function i.e the scope is done and dusted for "myNightSky" function and for "myNightSky" function stars means "Sirius". So that's why you see those result variation.