Create a third variable called z, assign x + y to it, and display it. - Javascript Data Type

Javascript examples for Data Type:var

Description

Create a third variable called z, assign x + y to it, and display it.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<script>
var x = 5;/*from   w  ww  . j  a  va2 s  . c om*/
var y = 10;
var z = x + y;
document.getElementById("demo").innerHTML = z;
</script>

</body>
</html>

Related Tutorials