-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01_variables.js
More file actions
55 lines (42 loc) · 876 Bytes
/
Copy path01_variables.js
File metadata and controls
55 lines (42 loc) · 876 Bytes
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
/*
Javascript is a "dynamically typed" language.
The variable's type does not need to be defined beforehand.
Rules:
- Letter, Digit, Underscore and $ is allowed.
- First letter cannot be a digit.
Variable Types:
1. Primitive: Null, Undefined, Boolean, Number, Bigint, String
2. Non-primitive: Object
*/
// Null
n = null;
console.log(n);
// Undefined
u = undefined;
console.log(u);
// Boolean
isOkay = true;
console.log(isOkay);
isOkay = false;
console.log(isOkay);
// Number
a = 10;
console.log(a);
a = 36.77;
console.log(a);
// Bigint
b = 1234567890123456789012345n; // suffix 'n' indicates a Bigint
console.log(b);
// String
str = "Tapashee Tabassum"
console.log(str);
// Symbol
s = Symbol();
console.log(s);
// Object
person = {
firstName: "Tapashee Tabassum",
lastName: "Urmi",
age: 33
};
console.log(person);