Skip to content

Commit ce5d33f

Browse files
Merge pull request #96 from wakidurrahman/docs/theoretical-question-010
docs: updated
2 parents c438455 + bc851b9 commit ce5d33f

File tree

1 file changed

+61
-1
lines changed

1 file changed

+61
-1
lines changed

docs/interview-questions.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Theoretical Questions
22

3-
`Q001:` What is typeof Operator?
3+
`Q001:` What is `typeof` Operator?
44

55
Answer: JavaScript provides a `typeof` operator that can examine a value tell you what type is is:
66

@@ -51,3 +51,63 @@ obj['b'];
5151
obj['c'];
5252
5353
```
54+
55+
`Q003:` Explain `arrays` in JavaScript.
56+
57+
Answer: An `array` is an object that holds values (of any type) not particularly in named properties/keys, but rather in numerically indexed positions:
58+
59+
```
60+
61+
const arr = [
62+
'hello world',
63+
42,
64+
true
65+
];
66+
67+
arr[0]; // 'hello world';
68+
arr[1]; // 42
69+
arr[3]; // true
70+
arr.length? // 3
71+
72+
73+
typeof arr; // "object";
74+
75+
```
76+
77+
`Q004:` What is `scope` in JavaScript?
78+
79+
Answer: In JavaScript, each function gets its own scope. Scope is basically a collection of variables as well as the rules for how those variables are accessed by name. Only code inside that function can access that function's scoped variables.
80+
81+
1. A variable name has to be unique within the same scope.
82+
2. A scope can be nested inside another scope.
83+
3. If one scope is nested inside another, code inside the innermost scope can access variables from either scope.
84+
85+
86+
`Q005:` Explain `equality` in JavaScript.
87+
88+
Answer: JavaScript has both strict and type converting comparisons:
89+
90+
1. Strict comparison (`===`) checks for value quality without allowing coercion.
91+
92+
`Q006:` Explain equality in JavaScript.
93+
94+
95+
Answer:
96+
`Q007:` Explain equality in JavaScript.
97+
98+
99+
Answer:
100+
`Q008:` Explain equality in JavaScript.
101+
102+
103+
Answer:
104+
`Q009:` Explain equality in JavaScript.
105+
106+
107+
Answer:
108+
`Q010:` Explain equality in JavaScript.
109+
110+
111+
Answer:
112+
113+

0 commit comments

Comments
 (0)