Use a single var keyword to create three variables - Javascript Data Type

Javascript examples for Data Type:var

Description

Use a single var keyword to create three variables

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<script>
var firstName = "T", lastName = "J", age = 35;

document.getElementById("demo").innerHTML =
firstName + " " + lastName + " is " + age;
</script>/* w w w  .  ja  v a 2 s. c  om*/

</body>
</html>

Related Tutorials