-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariable.js
95 lines (49 loc) · 1.54 KB
/
variable.js
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// variable are containers for data
//always gives a meanning full name for a variable.
// age is integer value
age = 19;
console.log(age);
// fullname is work like a string
fullname="vaibhav gund";
console.log(fullname);
// null means i know this value but this variable is mt
x = null;
console.log(x);
// value is undefine it means i dont know what value in this
y = undefined;
console.log(y);
// meannig full name like a following......
radius = 23;
console.log(radius);
salary = 34570;
console.log(salary);
height = 165.5;
console.log(height);
// boolean type = true / false
// example
isfollow = true;
console.log(isfollow);
isFollow = false;
console.log(isfollow);
// rule of variable //
// variable name are case sensitive 'a' and 'A' is a different.
// only letter, digits,underscore(_) and $ is allowed.(not even space)
// only letter ,underscore (_) or $ should be 1st character.
// reserved words cannot be variable names.
// keywords
// var ====== variable can be re declared and updated .global scope variable. ....... .do not use
// let === variable cannot be re declared but can be updated a block scope variable. ....... . declare at onetime
// const ==== variable cannot be re declared or updated a block scope variable........ . use mostly
// let
let name = "vaibhav gund ";
console.log(name);
name ="kedarnath";
let fullName = "vaibhav bhausaheb gund";
let totalPrice = 100000;
console.log (totalPrice);
// let and const are a block scope variable
{
let a =40;
a = 30;
console.log(a);
}