forked from Pushkar111/JavaScript-ZeroToHero
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
41 lines (38 loc) · 954 Bytes
/
script.js
File metadata and controls
41 lines (38 loc) · 954 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
/*
-> Primitives Data types → 7 Types
========================
nn ss bb u
1. Null
2. Number
3. Symbol
4. String
5. Boolean
6. BigInt
7. Undefined
*/
let a = null;
let b = 345;
let c = Symbol("I am a nice symbol");
let d = "JavaScript";
let e = true;
let f = BigInt("567") + BigInt("3");
let g = undefined; // let g; // same as let g = undefined;
console.log(a, b, c, d, e, f, g);
console.log("type of a :", typeof a);
console.log("type of b :", typeof b);
console.log("type of c :", typeof c);
console.log("type of d :", typeof d);
console.log("type of e :", typeof e);
console.log("type of f :", typeof f);
console.log("type of g :", typeof g);
// objects in js (non-primitive data types)
const item = {
"JavaScript": true,
"Shubh": false,
"Lovish": 67,
"Rohan": undefined
}
console.log(item["JavaScript"]);
console.log(item["Shubh"]);
console.log(item["Lovish"]);
console.log(item["Rohan"]);