In this tutorial there is written:
If you redeclare a JavaScript variable, it will not lose its value.
Why should I redeclare a variable? Is it
It is pretty simple re-declaring doesn't actually affect anything, you just have to remember that if you reassign value within scope then the reassigned value is limited to scope and outside of scope it will still be globally declared value
var page =1 ;
function htmlcode(page) {
page = "keka";
console.log("inside " + page);
}
htmlcode(page);
console.log("inside " + page);
Output : inside keka
inside 1