File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Theoretical Questions
2
+
3
+ ` Q001: ` What is typeof Operator?
4
+
5
+ Answer: JavaScript provides a ` typeof ` operator that can examine a value tell you what type is is:
6
+
7
+ ```
8
+
9
+ let a;
10
+ typeof a; // 'undefined'
11
+
12
+ a = "hello world";
13
+ typeof a; // "string";
14
+
15
+
16
+ a = 44;
17
+ typeof a; // "number"
18
+
19
+ a = null;
20
+ typeof a; // 'object'
21
+
22
+ a = true;
23
+ typeof a; // "boolean";
24
+
25
+ a = undefined;
26
+ typeof a; // "undefined";
27
+
28
+ a = { b: 'c'};
29
+ typeof a; // "object"
30
+
31
+
32
+ ```
33
+
34
+ ` Q002: ` What is the ` object ` type?
35
+
36
+ Answer: The ` object ` type refers to a compound value where you can set properties(named locations) that each hold their own values of any type.
37
+
38
+ ```
39
+ const obj = {
40
+ a: 'Hello World" ,
41
+ b: 42,
42
+ c: true
43
+ };
44
+
45
+ obj.a;
46
+ obj.b;
47
+ obj.c;
48
+
49
+ obj['a'];
50
+ obj['b'];
51
+ obj['c'];
52
+
53
+ ```
You can’t perform that action at this time.
0 commit comments