Programming Code Center(PCC)
[JS]

(PCC)::[How-to-use-JavaScript-variables]::[js]

File Name : index.html

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Variables</h2>

<p>In this example, x is defined as a variable.
Then, x is assigned the value of 6:</p>

<p id="demo"></p>

<script>
var x;
x = 6;
document.getElementById("demo").innerHTML = x;
</script>

</body>
</html>

Output :

JavaScript Variables

In this example, x is defined as a variable. Then, x is assigned the value of 6: