-
Notifications
You must be signed in to change notification settings - Fork 3
/
08 Variables.html
34 lines (30 loc) · 1.49 KB
/
08 Variables.html
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
<html lang="en">
<head><title>Variables</title>
<!-- In programming, a variable is a value that can change, depending on conditions or
on information passed to the program.
Typically, a program consists of instructions that tells the computer what to do
and data that the program uses when it is running.
A JavaScript variable/variable is simply a name of storage location.
There are two types of variables in JavaScript : local variable and global variable.
There are some rules while declaring a variable (also known as identifiers).
Name must start with a letter (a to z or A to Z), underscore( _ ), or dollar( $ ) sign.
-->
</head>
<body>
<script type="text/javascript">
/*
JavaScript is a dynamic type language, means you don't need to specify type of the
variable because it is dynamically used by JavaScript engine.
you need to use var, to specify that its variable
It can hold any type of values such as numbers, strings etc.
//extra information:
In computer terminology, however, dynamic usually means "capable of action or change,"
while static means "fixed."
*/
var x=5;
x=20; // changes value of x now x is 20
x="Muazim"; // changes its value to string
alert(x); // displays value of x in popup box
</script>
</body>
</html>