- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariable.js
More file actions
Latest commit
73 lines (54 loc) · 1.4 KB
/
Copy pathvariable.js
File metadata and controls
73 lines (54 loc) · 1.4 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
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
//String, int,byte,short,long,char,float,boolean
//There are 3 types variable in javaScript
// let, var, const
console.log("-----------use of var-------------")
//we can reassign and redeclare value with var
varfirstName="Sakib";
varage=35;
vargrade=3.5;
varusCitizen=false;
varsex='M';
//check the type of variable
console.log(typeof(age));
console.log(typeof(usCitizen));
//redeclare variable with var
varfirstName="Tamim";
console.log(firstName)
//reassign the value with var
grade=3.1;
console.log(grade)
console.log("-----------use of let-------------")
// we can't redeclare but we can reassign the value with let
letfirstName1="Tamim";
//let name = "Iqubal";
//undefined value
letlastName="";
letage1=35;
letgrade1=3.5;
letusCitizen1='';
letsex1='M';
console.log(firstName1)
console.log(lastnName)
console.log(usCitizen1)
//we can't redeclare variable with let
//let firstName = "Afif";
//reassign the value with let
firstName1="Musfiq";
console.log(firstName1);
console.log("-----------use of const-------------")
//we can't neither redeclare or reassign const variable
constfirstName2="Sakib";
constage2=35;
constgrade2=3.5;
constusCitizen2=false;
constsex2='M';
console.log(age2)
/*
we can't reassign value with const variable
firstName2 = "Shoan";
console.log(firstName2);
*/
/*
we can't redeclare value with const
const firstName2 = "Afif";
*/