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 practical in some situations?
thank you
It's nothing more than a reminder that if you do this:
var x=5; var x; alert(x);
Result will be 5.
If you re-declare variable in some other languages for example - result will be undefined, or NaN, but not in javascript.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With