Here you can find a number of examples on Java Script.Please find the various kinds of examples listed on the right side of this site. If you don't find anything on Java Script then please write to us or leave a commnet. We are pleased to help and find the solution of your problem.

Javascript: Type of Variable



Javascript consist of four types of Variable.

1. Integer: Number consist of integer and floating values.
2. String: A string user sequence of 1 or more than 1 characters that are enclosed by doublequotes(" ") or singlequotes(' ').
3. Bool: Boolean consist of Logical values i.e. True or False.
4. Null: Null consist of single value. Null which identifies null, empty or not existing reference.



Example:

<html>
<head>
<titleTypes of Variable</title>
</head>
<body>

<script language="javascript">
var intval=30;
var floatval=8.50;
var stringval="Hello";
var booleanval=true;
document.write("Integer value = " + intval + "<br>");
document.write("Float value = " + floatval + "<br>");
document.write("String value = " + stringval + "<br>");
document.write("Boolean value = " + booleanval + "<br>");
</script>

</body>
</html>



OUTPUT

Integer value = 30
Float value = 8.5
String value = Hello
Boolean value = true

No comments:

Post a Comment

Google