-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTutorial3 variable.html
More file actions
37 lines (32 loc) · 1.24 KB
/
Tutorial3 variable.html
File metadata and controls
37 lines (32 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!doctype html>
<html>
<head>
<title>
Tutorial 1 JavaScript -- defining variables.
</title>
</head>
<body>
<script type="text/javascript">
var x = 23; // Declaring an Int variable
var y = "This is String variable" ;// Declaring a String variable
var z = 123.12 ;// Declaring a float variable.
var r= true ; // Declaring a boolean variable.
var X = 2242 ; // Declaring X as variable
document.write(typeof(x)+"<br/>");
document.write(typeof(y)+"<br/>");
document.write(typeof(z)+"<br/>");
document.write(typeof(r)+"<br/>");
document.write(typeof(X)+"<br/>");
document.write(x+"<br/>");
document.write(y+"<br/>");
document.write(z+"<br/>");
document.write(r+"<br/>");
document.write(X+"<br/>");
/* Take Aways: - Float and Int are of type numbers.
- typeof gives type of variables.
- variables are case sensitive. x and X are different.
- + is used as string concatenation.
- "<br/>" used to move the cursor to next line.*/
</script>
</body>
</html>