(PCC)::[How-to-Re-declaring-a-variable-will-not-destroy-the-value-in-JavaScript]::[js]
<!DOCTYPE html> <html> <body> <h2>JavaScript Variables</h2> <p>If you re-declare a JavaScript variable, it will not lose its value.</p> <p id="demo"></p> <script> var carName = "Volvo"; var carName; document.getElementById("demo").innerHTML = carName; </script> </body> </html>
If you re-declare a JavaScript variable, it will not lose its value.