@@ -980,14 +980,14 @@ This is where an event loop starts to work. An **event loop** looks at the stack
#### āĻāϤā§āϤāϰ: C
-The deepest nested element that caused the event is the target of the event. You can stop bubbling by `event.stopPropagation`
+āĻāĻā§āύā§āĻā§āϰ āĻāĻžāϰā§āĻā§āĻ āĻšāĻā§āĻā§ āĻĄāĻŽā§āϰ āĻāĻā§āϰāϤāĻŽ āύā§āϏā§āĻā§āĻĄ āĻāϞāĻŋāĻŽā§āϝāĻžāύā§āĻ āϝ⧠āĻāύāĻā§āύāĻāĻŋ āĻāĻāĻŋā§ā§āĻā§āĨ¤
---
-###### 32. When you click the paragraph, what's the logged output?
+###### 32. āϝāĻāύ āĻĒā§āϝāĻžāϰāĻžāĻā§āϰāĻžāĻĢā§ āĻā§āϞāĻŋāĻ āĻāϰāĻŦā§āύ, āϞāĻ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻŋ āĻšāĻŦā§?
```html
@@ -1007,6 +1007,9 @@ The deepest nested element that caused the event is the target of the event. You
If we click `p`, we see two logs: `p` and `div`. During event propagation, there are 3 phases: capturing, targeting, and bubbling. By default, event handlers are executed in the bubbling phase (unless you set `useCapture` to `true`). It goes from the deepest nested element outwards.
+`p` āϤ⧠āĻā§āϞāĻŋāĻ āĻāϰāϞā§āĻ āĻāĻŽāϰāĻž ⧍āĻāĻž āϞāĻ āĻĻā§āĻāϤ⧠āĻĒāĻžāĻāĻ `p` āĻ `div`āĨ¤
+āĻāĻā§āύā§āĻ āĻĒā§āϰā§āĻĒāĻžāĻā§āĻļāύ āĻāϰ āϏāĻŽā§ ā§ŠāĻāĻž āĻĒāϰā§āϝāĻžā§ āĻĨāĻžāĻā§ āĻā§āϝāĻžāĻĒāĻāĻžāϰāĻŋāĻ, āĻāĻžāϰāĻā§āĻāĻŋāĻ, āĻ āĻŦāĻžāĻŦāϞāĻŋāĻāĨ¤ āϏā§āĻŦāĻžāĻŦāĻžāĻŦāĻŋāĻāĻāĻžāĻŦā§āĻ āĻāĻā§āύā§āĻ āĻšā§āϝāĻžāύā§āĻĄāϞāĻžāϰāĻā§āϞ⧠āĻāĻžāĻ āĻāϰ⧠āĻŦāĻžāĻŦāϞāĻŋāĻ āĻĒāϰā§āϝāĻžā§ā§ (āϝāĻĻāĻŋ āύāĻž āĻāĻĒāύāĻŋ `capture` āĻā§ `true` āĻāϰ⧠āĻĻā§āύ)āĨ¤ āĻāĻāĻž āĻāĻā§āϰāϤāĻŽ āύā§āϏā§āĻā§āĻĄ āĻāϞāĻŋāĻŽā§āϝāĻžāύā§āĻ āĻĨā§āĻā§ āĻŦāĻžāĻšāĻŋāϰā§āϰ (āĻĒā§āϝāĻžāϰā§āύā§āĻā§āϰ) āĻĻāĻŋāĻā§ āϝāĻžā§āĨ¤
+
@@ -1015,7 +1018,7 @@ If we click `p`, we see two logs: `p` and `div`. During event propagation, there
###### 33. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const person = { name: "Lydia" };
+const person = { name: 'Lydia' };
function sayHi(age) {
return `${this.name} is ${age}`;
@@ -1035,9 +1038,9 @@ console.log(sayHi.bind(person, 21));
#### āĻāϤā§āϤāϰ: D
-With both, we can pass the object to which we want the `this` keyword to refer to. However, `.call` is also _executed immediately_!
+`.call` āĻ `.bind` āĻĻā§āĻāĻŋ āĻĻāĻŋā§ā§āĻ āĻāĻŽāϰāĻž `this` āĻāĻŋāĻā§āĻžāϰā§āĻĄāĻāĻŋ āϰā§āĻĢāĻžāϰ āĻāϰāĻž āĻ
āĻŦāĻā§āĻā§āĻ āĻĒāĻžāϏ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻāĻŋāύā§āϤ⧠`.call` āĻāĻāĻ āϏāĻžāĻĨā§ āĻāϞāĻ āĻšā§ā§ āϝāĻžāĻā§āĻā§āĨ¤
-`.bind.` returns a _copy_ of the function, but with a bound context! It is not executed immediately.
+`.bind.` āĻāϰ āĻŦā§āϞāĻžā§ āϏ⧠_āĻĢāĻžāĻāĻļāύā§āϰ āĻāĻĒāĻŋ_'āϰ āϏāĻžāĻĨā§ `this` āĻāϰ āĻāĻāĻāĻŋ āĻāĻžāϰā§āϝāĻāϰ (bound) āĻāύāĻā§āϝāĻžāĻā§āϏ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ āĻāĻŋāύā§āϤ⧠āĻāĻāĻ āϏāĻžāĻĨā§ āĻāϞ āĻšā§ āύāĻžāĨ¤
@@ -1064,21 +1067,22 @@ console.log(typeof sayHi());
#### āĻāϤā§āϤāϰ: B
-The `sayHi` function returns the returned value of the immediately invoked function expression (IIFE). This function returned `0`, which is type `"number"`.
-FYI: `typeof` can return the following list of values: `undefined`, `boolean`, `number`, `bigint`, `string`, `symbol`, `function` and `object`. Note that `typeof null` returns `"object"`.
+`sayHi` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāĻŽāĻŋāĻĄāĻŋā§ā§āĻāϞāĻŋ āĻāύāĻā§āĻāĻĄ āĻĢāĻžāĻāĻļāύ āĻāĻā§āϏāĻĒā§āϰā§āĻļāύā§āϰ (IIFE) āϰāĻŋāĻāĻžāϰā§āύ āĻā§āϝāĻžāϞā§āĻāĻŋāĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§āĨ¤ āĻāĻ āĻĢāĻžāĻāĻļāύāĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĻā§ `0` āϝā§āĻāĻŋāϰ āĻāĻžāĻāĻĒ āĻšāĻā§āĻā§ āĻāĻāĻāĻŋ `"number"`āĨ¤
+
+> āĻā§āύ⧠āϰāĻžāĻā§āύāĻ `typeof` āϞāĻŋāϏā§āĻā§ āĻāϞā§āϞā§āĻāĻŋāϤ āĻā§āϝāĻžāϞā§āĻā§āϞ⧠āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāϤ⧠āĻĒāĻžāϰā§āĻ `undefined`, `boolean`, `number`, `bigint`, `string`, `symbol`, `function` āĻāĻŦāĻ `object`āĨ¤ āĻŽāύ⧠āϰāĻžāĻāĻŦā§āύ āϝ⧠`typeof null` āĻāĻŋāύā§āϤ⧠`"object"` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤
---
-###### 35. Which of these values are falsy?
+###### 35. āĻā§āύ āĻā§āϝāĻžāϞā§āĻā§āϞ⧠āĻŽāĻŋāĻĨā§āϝāĻž āĻšā§?
```javascript
0;
new Number(0);
-("");
-(" ");
+('');
+(' ');
new Boolean(false);
undefined;
```
@@ -1093,7 +1097,7 @@ undefined;
#### āĻāϤā§āϤāϰ: A
-There are 8 falsy values:
+āĻŽā§āĻ ā§Ž āϰāĻāĻŽā§āϰ āĻŽāĻŋāĻĨā§āϝāĻž āĻā§āϝāĻžāϞ⧠āĻšā§āĻ
- `undefined`
- `null`
@@ -1104,7 +1108,7 @@ There are 8 falsy values:
- `-0`
- `0n` (BigInt(0))
-Function constructors, like `new Number` and `new Boolean` are truthy.
+āĻĢāĻžāĻāĻļāύ āĻāύā§āϏāĻā§āϰāĻžāĻā§āĻāϰāĻā§āϞā§, āϝā§āĻŽāύ `new Number` āĻ `new Boolean` āϏāĻŦāϏāĻŽā§ āϏāϤā§āϝ āĻšā§āĨ¤ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻā§ āĻĢāĻžāĻāĻļāύāĻā§āϞ⧠āĻšā§ āĻ
āĻŦāĻā§āĻā§āĻ āĻāĻŦāĻ āĻāϰāĻž āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāĻžāĻāĻĒāĨ¤ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāĻžāĻāĻĒ āĻāĻāύ⧠āĻŽāĻŋāĻĨā§āϝāĻž āĻšā§ āύāĻžāĨ¤
@@ -1127,8 +1131,8 @@ console.log(typeof typeof 1);
#### āĻāϤā§āϤāϰ: B
-`typeof 1` returns `"number"`.
-`typeof "number"` returns `"string"`
+`typeof 1` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`"number"`.
+āĻāϰ `typeof "number"` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`"string"`
@@ -1153,11 +1157,11 @@ console.log(numbers);
#### āĻāϤā§āϤāϰ: C
-When you set a value to an element in an array that exceeds the length of the array, JavaScript creates something called "empty slots". These actually have the value of `undefined`, but you will see something like:
+āĻāĻĒāύāĻŋ āϝāĻāύ āĻ
ā§āϝāĻžāϰā§āϰ āĻāĻŽāύ āĻā§āύ āĻāύāĻĄā§āĻā§āϏ⧠āĻāĻāĻāĻŋ āĻā§āϝāĻžāϞ⧠āϏā§āĻ āĻāϰā§āύ āϝā§āĻāĻž āĻ
ā§āϝāĻžāϰā§āϰ āĻĻā§āϰā§āĻā§āϝāĻā§ āĻ
āϤāĻŋāĻā§āϰāĻŽ āĻāϰ⧠āĻĢā§āϞā§, āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āϤāĻāύ "empty slots" āύāĻžāĻŽā§ āĻāĻŋāĻā§ āϤāĻŋāϰāĻŋ āĻāϰā§āĨ¤ āĻāĻāĻžāϰ āĻā§āϝāĻžāϞ⧠āĻāϏāϞ⧠`undefined` āĻāĻŋāύā§āϤ⧠āĻāĻĒāύāĻŋ āĻĻā§āĻāϤ⧠āĻĒāĻžāĻŦā§āύ āĻāĻŽāύ āĻāĻŋāĻā§āĻ
`[1, 2, 3, empty x 7, 11]`
-depending on where you run it (it's different for every browser, node, etc.)
+āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻā§āĻĨāĻžā§ āĻāϞāĻā§ āϤāĻžāϰ āĻāĻĒāϰ āĻāĻŋāϤā§āϤāĻŋ āĻāϰ⧠(āĻāĻāĻž āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻŦā§āϰāĻāĻāĻžāϰ, āύā§āĻĄ āĻāϤā§āϝāĻžāĻĻāĻŋāϰ āĻāύā§āϝ āĻāϞāĻžāĻĻāĻž)
@@ -1190,18 +1194,18 @@ depending on where you run it (it's different for every browser, node, etc.)
#### āĻāϤā§āϤāϰ: A
-The `catch` block receives the argument `x`. This is not the same `x` as the variable when we pass arguments. This variable `x` is block-scoped.
+`catch` āĻŦā§āϞāĻāĻāĻŋ āĻāĻāĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻ `x` āϰāĻŋāϏāĻŋāĻ āĻāϰā§āĻā§āĨ¤ āĻāĻŽāϰāĻž āϝāĻāύ āĻāϰā§āĻā§āĻŽā§āĻāϏ āĻĒāĻžāϏ āĻāϰāĻāĻŋ āĻāĻāĻž āĻāϰ `x` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞ āĻāĻāĻ āύā§āĨ¤ āĻāĻ `x` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻāĻŋ āĻšāϞ āĻŦā§āϞāĻ-āϏā§āĻā§āĻĒāĻĄāĨ¤
-Later, we set this block-scoped variable equal to `1`, and set the value of the variable `y`. Now, we log the block-scoped variable `x`, which is equal to `1`.
+āĻĒāϰāĻŦāϰā§āϤā§āϤā§, āĻāĻŽāϰāĻž āĻŦā§āϞāĻ-āϏā§āĻā§āĻĒāĻĄ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āϏā§āĻ āĻāϰāĻāĻŋ `1` āĻāĻŦāĻ `y` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āϏā§āĻ āĻāϰāĻāĻŋ `2`āĨ¤ āĻāĻāύ, āĻāĻŽāϰāĻž āϞāĻ āĻāϰāĻāĻŋ āĻŦā§āϞāĻ-āϏā§āĻā§āĻĒāĻĄ `x` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻāĻŋ, āϝā§āĻāĻž āϏāĻŽāĻžāύ āĻšāϞ `1`āĨ¤
-Outside of the `catch` block, `x` is still `undefined`, and `y` is `2`. When we want to `console.log(x)` outside of the `catch` block, it returns `undefined`, and `y` returns `2`.
+āĻā§āϝāĻžāĻ-āĻŦā§āϞāĻā§āϰ āĻŦāĻžāĻāϰ⧠`x` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻāĻŋ āĻāĻāύ⧠`undefined` āĻāĻŦāĻ `y` āĻšāϞ `2`āĨ¤ āϝāĻāύ āĻā§āϝāĻžāĻ-āĻŦā§āϞāĻā§āϰ āĻŦāĻžāĻāϰ⧠`console.log(x)` āĻāϰāϤ⧠āĻāĻžāĻā§āĻāĻŋ, āĻāĻāĻž āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`undefined`, āĻāĻŦāĻ `y` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`2`āĨ¤
---
-###### 39. Everything in JavaScript is either a...
+###### 39. āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻā§ āϏāĻŦāĻāĻŋāĻā§āĻ āĻšā§ āĻāĻāĻāĻŋ ...... āĨ¤
- A: primitive or object
- B: function or object
@@ -1213,11 +1217,11 @@ Outside of the `catch` block, `x` is still `undefined`, and `y` is `2`. When we
#### āĻāϤā§āϤāϰ: A
-JavaScript only has primitive types and objects.
+āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻā§ āĻāĻā§ āĻā§āĻŦāϞ āĻĒā§āϰāĻŋāĻŽāĻŋāĻāĻŋāĻ (āĻŽā§āϞāĻŋāĻ) āĻāĻžāĻāĻĒ āĻ āĻ
āĻŦāĻā§āĻā§āĻāĨ¤
-Primitive types are `boolean`, `null`, `undefined`, `bigint`, `number`, `string`, and `symbol`.
+āĻĒā§āϰāĻŋāĻŽāĻŋāĻāĻŋāĻ (āĻŽā§āϞāĻŋāĻ) āĻāĻžāĻāĻĒāĻā§āϞ⧠āĻšāϞ - `boolean`, `null`, `undefined`, `bigint`, `number`, `string`, āĻ `symbol`āĨ¤
-What differentiates a primitive from an object is that primitives do not have any properties or methods; however, you'll note that `'foo'.toUpperCase()` evaluates to `'FOO'` and does not result in a `TypeError`. This is because when you try to access a property or method on a primitive like a string, JavaScript will implicitly wrap the primitive type using one of the wrapper classes, i.e. `String`, and then immediately discard the wrapper after the expression evaluates. All primitives except for `null` and `undefined` exhibit this behavior.
+āĻĒā§āϰāĻŋāĻŽāĻŋāĻāĻŋāĻ āĻāĻžāĻāĻĒā§āϰ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏ/āĻŽā§āĻĨāĻĄ āύā§āĻ āĻāĻāĻžāĻ āĻāĻāĻāĻŋ āĻĒā§āϰāĻŋāĻŽāĻŋāĻāĻŋāĻ āĻāĻžāĻāĻĒāĻā§ āĻ
āĻŦāĻā§āĻā§āĻ āĻĨā§āĻā§ āĻāϞāĻžāĻĻāĻž āĻāϰā§āĻā§; āĻ
āύā§āϝāĻĻāĻŋāĻā§ āĻāĻĒāύāĻŋ āĻā§ā§āĻžāϞ āĻāϰāĻŦā§āύ āϝ⧠`'foo'.toUpperCase()` āĻāύāύāĻž āĻāϰāĻā§ `'FOO'` āĻāĻŦāĻ āĻā§āύ `TypeError`āĻ āĻĻā§ā§ āύāĻžāĨ¤ āĻāĻāĻžāϰ āĻāĻžāϰāύ āĻšāϞ, āĻāĻĒāύāĻŋ āϝāĻāύ āĻā§āύ āĻĒā§āϰāĻŋāĻŽāĻŋāĻāĻŋāĻ āĻāĻžāĻāĻĒ āϝā§āĻŽāύ āϏā§āĻā§āϰāĻŋāĻ āĻĻāĻŋā§ā§ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏ/āĻŽā§āĻĨāĻĄ āĻā§ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻāĻžāĻā§āĻā§āύ, āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āϤāĻāύ āĻĒā§āϰāĻŋāĻŽāĻŋāĻāĻŋāĻ āĻāĻžāĻāĻĒāĻā§ āϰâā§āϝāĻžāĻĒāĻžāϰ āĻā§āϞāĻžāϏāĻā§āϞā§āϰ āĻāĻāĻāĻŋ āϝā§āĻŽāύ, `String` āĻĻāĻŋā§ā§ āĻŽā§ā§ā§ āĻĻā§ā§, āĻāĻŦāĻ āĻŽāĻžāύ āĻāύāύāĻž āĻšā§ā§ āϝāĻžāĻā§āĻžāϰ āϏāĻžāĻĨā§ āϏāĻžāĻĨā§āĻ āϏā§āĻāĻŋ āĻŦāĻžāϤāĻŋāϞ āĻšā§ā§ āϝāĻžā§āĨ¤ `null` āĻ `undefined` āĻŦāĻžāĻĻā§ āϏāĻāϞ āĻĒā§āϰāĻŋāĻŽāĻŋāĻāĻŋāĻāĻ āĻāĻāĻ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻĒā§āϰāĻĻāϰā§āĻļāύ āĻāϰā§āĨ¤
@@ -1248,9 +1252,9 @@ What differentiates a primitive from an object is that primitives do not have an
#### āĻāϤā§āϤāϰ: C
-`[1, 2]` is our initial value. This is the value we start with, and the value of the very first `acc`. During the first round, `acc` is `[1,2]`, and `cur` is `[0, 1]`. We concatenate them, which results in `[1, 2, 0, 1]`.
+āĻāĻāĻžāύ⧠`[1, 2]` āĻāĻŽāĻžāĻĻā§āϰ āĻĒā§āϰāĻĨāĻŽāĻŋāĻ āĻā§āϝāĻžāϞā§āĨ¤ āĻāĻ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻĻāĻŋā§ā§āĻ āĻāĻŽāϰāĻž āĻļā§āϰ⧠āĻāϰāĻŦ āĻāĻŦāĻ āĻāĻāĻžāĻ `acc` āĻāϰ ā§§āĻŽ āĻā§āϝāĻžāϞā§āĨ¤ ā§§āĻŽ āϰāĻžāĻāύā§āĻĄā§āϰ āϏāĻŽā§, `acc` āĻšā§ `[1,2]`, āĻāĻŦāĻ `cur` āĻšā§ `[0, 1]`āĨ¤ āĻāĻŽāϰāĻž āϤāĻžāĻĻā§āϰāĻā§ āϝā§āĻā§āϤ āĻāϰāĻāĻŋ, āϝā§āĻāĻžāϰ āĻĢāϞāĻžāĻĢāϞ āĻšāϞ `[1, 2, 0, 1]`āĨ¤
-Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and get `[1, 2, 0, 1, 2, 3]`
+āĻĒāϰāĻŦāϰā§āϤā§āϤ⧠⧍ā§/āĻļā§āώ āϧāĻžāĻĒā§, `acc` āĻšā§ `[1, 2, 0, 1]` āĻāĻŦāĻ `cur` āĻšā§ `[2, 3]`, āĻāĻŽāϰāĻž āϤāĻžāĻĻā§āϰāĻā§ āϝā§āĻā§āϤ āĻāϰ⧠āĻĢāϞāĻžāĻĢāϞ āĻĒāĻžāĻā§āĻāĻŋ `[1, 2, 0, 1, 2, 3]`āĨ¤
@@ -1261,7 +1265,7 @@ Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and ge
```javascript
!!null;
-!!"";
+!!'';
!!1;
```
@@ -1275,21 +1279,23 @@ Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and ge
#### āĻāϤā§āϤāϰ: B
-`null` is falsy. `!null` returns `true`. `!true` returns `false`.
+`null` āĻšāϞ āĻŽāĻŋāĻĨā§āϝāĻžāĨ¤ `!null` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`true`āĨ¤ `!true` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`false`.
+
+`""` āĻšāϞ āĻŽāĻŋāĻĨā§āϝāĻžāĨ¤ `!""` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`true`āĨ¤ `!true` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`false`āĨ¤
-`""` is falsy. `!""` returns `true`. `!true` returns `false`.
+`1` āĻšāϞ āϏāϤā§āϝāĨ¤ `!1` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`false`āĨ¤ `!false` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`true`āĨ¤
-`1` is truthy. `!1` returns `false`. `!false` returns `true`.
+āϤāĻžāĻ āϏāĻ āĻŋāĻ āĻšāϞ - `false` `false` `true`āĨ¤
---
-###### 42. What does the `setInterval` method return in the browser?
+###### 42. āĻāĻ `setInterval` āĻŽā§āĻĨāĻĄāĻāĻŋ āĻŦā§āϰāĻžāĻāĻāĻžāϰ⧠āĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§?
```javascript
-setInterval(() => console.log("Hi"), 1000);
+setInterval(() => console.log('Hi'), 1000);
```
- A: a unique id
@@ -1302,17 +1308,17 @@ setInterval(() => console.log("Hi"), 1000);
#### āĻāϤā§āϤāϰ: A
-It returns a unique id. This id can be used to clear that interval with the `clearInterval()` function.
+āϝāĻĻāĻŋāĻ āĻāĻāĻŋ āĻŦāĻžāĻāĻāĻžāϰ⧠⧧ āϏā§āĻā§āύā§āĻĄ āĻĒāϰ āĻĒāϰ `'Hi'` āϞāĻ āĻāϰā§āĻ āϝāĻžāĻŦā§ āĻāĻŋāύā§āϤ⧠`setInterval` āĻŽā§āĻĨāĻĄāĻāĻŋ āĻāĻāĻāĻŋ āĻ
āύāύā§āϝ āĻāĻāĻĄāĻŋ (unique id) āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ āĻāĻ āĻĒā§āϰā§āϝāĻžā§āĻā§āϰāĻŽāĻŋāĻ āĻāĻžāĻāĻā§ `clearInterval()` āĻĻāĻŋā§ā§ āĻŽā§āĻā§ āĻĢā§āϞāϤ⧠āĻ āĻāĻāĻĄāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻž āĻšā§āĨ¤
---
-###### 43. What does this return?
+###### 43. āĻāĻāĻž āĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§?
```javascript
-[..."Lydia"];
+[...'Lydia'];
```
- A: `["L", "y", "d", "i", "a"]`
@@ -1325,7 +1331,7 @@ It returns a unique id. This id can be used to clear that interval with the `cle
#### āĻāϤā§āϤāϰ: A
-A string is an iterable. The spread operator maps every character of an iterable to one element.
+āϏā§āĻā§āϰāĻŋāĻ āĻāĻāĻāĻŋ āĻĒā§āύāϰāĻžāĻŦā§āϤā§āϤāĻŋāϝā§āĻā§āϝ āĻāĻžāĻāĻĒāĨ¤ āϏā§āĻĒā§āϰā§āĻĄ āĻ
āĻĒāĻžāϰā§āĻāϰ āĻĒā§āύāϰāĻžāĻŦā§āϤā§āϤāĻŋāϝā§āĻā§āϝ āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻ
āĻā§āώāϰāĻā§ āĻŽā§āϝāĻžāĻĒ āĻāϰ⧠āĻāĻāĻāĻŋ āĻāϞāĻŋāĻŽā§āύā§āĻā§ āύāĻŋā§ā§ āĻāϏā§āĨ¤ āϤāĻžāĻ āĻĢāϞāĻžāĻĢāϞ āĻšā§ `["L", "y", "d", "i", "a"]`āĨ¤
@@ -1356,11 +1362,11 @@ console.log(gen.next().value);
#### āĻāϤā§āϤāϰ: C
-Regular functions cannot be stopped mid-way after invocation. However, a generator function can be "stopped" midway, and later continue from where it stopped. Every time a generator function encounters a `yield` keyword, the function yields the value specified after it. Note that the generator function in that case doesnât _return_ the value, it _yields_ the value.
+āϏāĻžāϧāĻžāϰāύ āĻĢāĻžāĻāĻļāύāĻā§ āĻāϞ āĻāϰāĻžāϰ āĻĒāϰ āĻŽāĻžāĻāĻĒāĻĨā§ āĻĨāĻžāĻŽāĻŋā§ā§ āĻĻā§ā§āĻž āϝāĻžā§ āύāĻžāĨ¤ āĻ
āύā§āϝāĻĻāĻŋāĻā§, āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύāĻā§ āĻŽāĻžāĻāĻĒāĻĨā§ āĻĨāĻžāĻŽāĻŋā§ā§ āĻĻā§ā§āĻž āϝāĻžā§, āĻāĻŦāĻ āϝā§āĻāĻžāύ⧠āĻĨāĻžāĻŽāĻžāύ⧠āĻšā§ā§āĻāĻŋāϞ⧠āϏā§āĻāĻžāύ āĻĨā§āĻā§āĻ āĻĒā§āύāϰāĻžā§ āĻļā§āϰ⧠āĻāϰāĻž āϝāĻžā§āĨ¤ āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ āĻĒā§āϰāϤāĻŋāĻŦāĻžāϰ āĻāĻāĻāĻŋ `yield` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄā§āϰ āĻŽā§āĻā§āĻŽā§āĻāĻŋ āĻšāϝāĻŧ, āϤāĻāύ āĻĢāĻžāĻāĻļāύāĻāĻŋ āϤāĻžāϰ āĻĒāϰā§āϰ āύāĻŋāϰā§āĻĻāĻŋāώā§āĻ āĻāϰāĻž āĻā§āϝāĻžāϞā§āĻāĻŋ āĻĒā§āϰāĻĻāĻžāύ āĻāϰā§āĨ¤ āĻŽāύ⧠āϰāĻžāĻāĻŦā§āύ āϝ⧠āϏā§āĻ āĻā§āώā§āϤā§āϰ⧠āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ āĻŽāĻžāύāĻāĻŋ _āϰāĻŋāĻāĻžāϰā§āύ_ āĻāϰ⧠āύāĻž, āĻāĻāĻŋ āĻŽāĻžāύāĻāĻŋāĻā§ _āĻāϞā§āĻĄ_ āĻāϰ⧠(āĻĢāϞāĻžāĻĢāϞ āĻĒā§āϰāĻĻāĻžāύ)āĨ¤
-First, we initialize the generator function with `i` equal to `10`. We invoke the generator function using the `next()` method. The first time we invoke the generator function, `i` is equal to `10`. It encounters the first `yield` keyword: it yields the value of `i`. The generator is now "paused", and `10` gets logged.
+āĻĒā§āϰāĻĨāĻŽā§, āĻāĻŽāϰāĻž āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻļā§āϰ⧠āĻāϰāĻŋ `i` āĻāϰ āϏāĻŽāĻžāύ `10` āĻĻāĻŋāϝāĻŧā§āĨ¤ āĻāĻŽāϰāĻž `next()` āĻŽā§āĻĨāĻĄāĻāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ āĻāĻžāϞ⧠āĻāϰāĻŋāĨ¤ āĻĒā§āϰāĻĨāĻŽāĻŦāĻžāϰ āϝāĻāύ āĻāĻŽāϰāĻž āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ āĻāĻžāϞ⧠āĻāϰāĻŋ, `i` āϏāĻŽāĻžāύ `10`āĨ¤ āĻāĻāĻŋ āĻĒā§āϰāĻĨāĻŽ `yield` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄā§āϰ āĻŽā§āĻā§āĻŽā§āĻāĻŋ āĻšāϝāĻŧ: āĻāĻāĻŋ `i` āĻāϰ āĻŽāĻžāύ āĻĒā§āϰāĻĻāĻžāύ āĻāϰā§āĨ¤ āĻā§āύāĻžāϰā§āĻāϰāĻāĻŋ āĻāĻāύ "paused" āĻāϰāĻž āĻšāϝāĻŧā§āĻā§ āĻāĻŦāĻ `10` āϞāĻ āĻšāϝāĻŧā§ āĻā§āĻā§āĨ¤
-Then, we invoke the function again with the `next()` method. It starts to continue where it stopped previously, still with `i` equal to `10`. Now, it encounters the next `yield` keyword, and yields `i * 2`. `i` is equal to `10`, so it returns `10 * 2`, which is `20`. This results in `10, 20`.
+āϤāĻžāϰāĻĒāϰ, āĻāĻŽāϰāĻž āĻāĻŦāĻžāϰ `next()` āĻŽā§āĻĨāĻĄāĻāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāĻžāϞ⧠āĻāϰāĻŋāĨ¤ āĻāĻāύāĻ `i` āĻāϰ āϏāĻŽāĻžāύ `10` āύāĻŋāϝāĻŧā§ āĻāĻāĻŋ āĻĒā§āϰā§āĻŦā§ āϝā§āĻāĻžāύ⧠āĻĨāĻžāĻŽā§ āϏā§āĻāĻžāύ āĻĨā§āĻā§āĻ āĻāĻžāϞāĻŋāϝāĻŧā§ āϝā§āϤ⧠āĻļā§āϰ⧠āĻāϰā§āĨ¤ āĻāĻāύ, āĻāĻāĻŋ āĻĒāϰāĻŦāϰā§āϤ⧠`yield` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄā§āϰ āĻŽā§āĻā§āĻŽā§āĻāĻŋ āĻšāϝāĻŧ āĻāĻŦāĻ `i * 2` āĻĒāĻžā§āĨ¤ `i` āĻšāϞ `10` āĻāϰ āϏāĻŽāĻžāύ, āϤāĻžāĻ āĻāĻāĻŋ `10 * 2`, āϝāĻž āĻĒā§āϰāĻĻāĻžāύ āĻāϰ⧠`20`āĨ¤ āĻāϰ āĻĢāϞ⧠`10, 20` āĻĒāĻžāĻā§āĻāĻŋāĨ¤
@@ -1371,11 +1377,11 @@ Then, we invoke the function again with the `next()` method. It starts to contin
```javascript
const firstPromise = new Promise((res, rej) => {
- setTimeout(res, 500, "one");
+ setTimeout(res, 500, 'one');
});
const secondPromise = new Promise((res, rej) => {
- setTimeout(res, 100, "two");
+ setTimeout(res, 100, 'two');
});
Promise.race([firstPromise, secondPromise]).then((res) => console.log(res));
@@ -1401,7 +1407,7 @@ When we pass multiple promises to the `Promise.race` method, it resolves/rejects
###### 46. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-let person = { name: "Lydia" };
+let person = { name: 'Lydia' };
const members = [person];
person = null;
@@ -1441,7 +1447,7 @@ We are only modifying the value of the `person` variable, and not the first elem
```javascript
const person = {
- name: "Lydia",
+ name: 'Lydia',
age: 21,
};
@@ -1470,7 +1476,7 @@ With a `for-in` loop, we can iterate through object keys, in this case `name` an
###### 48. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-console.log(3 + 4 + "5");
+console.log(3 + 4 + '5');
```
- A: `"345"`
@@ -1497,7 +1503,7 @@ Operator associativity is the order in which the compiler evaluates the expressi
###### 49. What's the value of `num`?
```javascript
-const num = parseInt("7*6", 10);
+const num = parseInt('7*6', 10);
```
- A: `42`
@@ -1523,7 +1529,7 @@ Only the first number in the string is returned. Based on the _radix_ (the secon
```javascript
[1, 2, 3].map((num) => {
- if (typeof num === "number") return;
+ if (typeof num === 'number') return;
return num * 2;
});
```
@@ -1551,12 +1557,12 @@ However, we donât return a value. When we donât return a value from the func
```javascript
function getInfo(member, year) {
- member.name = "Lydia";
- year = "1998";
+ member.name = 'Lydia';
+ year = '1998';
}
-const person = { name: "Sarah" };
-const birthYear = "1997";
+const person = { name: 'Sarah' };
+const birthYear = '1997';
getInfo(person, birthYear);
@@ -1588,15 +1594,15 @@ The value of `person` is an object. The argument `member` has a (copied) referen
```javascript
function greeting() {
- throw "Hello world!";
+ throw 'Hello world!';
}
function sayHi() {
try {
const data = greeting();
- console.log("It worked!", data);
+ console.log('It worked!', data);
} catch (e) {
- console.log("Oh no an error:", e);
+ console.log('Oh no an error:', e);
}
}
@@ -1626,8 +1632,8 @@ With the `catch` statement, we can specify what to do if an exception is thrown
```javascript
function Car() {
- this.make = "Lamborghini";
- return { make: "Maserati" };
+ this.make = 'Lamborghini';
+ return { make: 'Maserati' };
}
const myCar = new Car();
@@ -1705,7 +1711,7 @@ Dog.prototype.bark = function () {
console.log(`Woof I am ${this.name}`);
};
-const pet = new Dog("Mara");
+const pet = new Dog('Mara');
pet.bark();
@@ -1770,7 +1776,7 @@ export default counter;
```javascript
// index.js
-import myCounter from "./counter";
+import myCounter from './counter';
myCounter += 1;
@@ -1799,7 +1805,7 @@ When we try to increment the value of `myCounter`, it throws an error: `myCounte
###### 58. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const name = "Lydia";
+const name = 'Lydia';
age = 21;
console.log(delete name);
@@ -1870,7 +1876,7 @@ This means that the value of `y` is equal to the first value in the array, which
###### 60. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const user = { name: "Lydia", age: 21 };
+const user = { name: 'Lydia', age: 21 };
const admin = { admin: true, ...user };
console.log(admin);
@@ -1896,9 +1902,9 @@ It's possible to combine objects using the spread operator `...`. It lets you cr
###### 61. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const person = { name: "Lydia" };
+const person = { name: 'Lydia' };
-Object.defineProperty(person, "age", { value: 21 });
+Object.defineProperty(person, 'age', { value: 21 });
console.log(person);
console.log(Object.keys(person));
@@ -1927,12 +1933,12 @@ Properties added using the `defineProperty` method are immutable by default. You
```javascript
const settings = {
- username: "lydiahallie",
+ username: 'lydiahallie',
level: 19,
health: 90,
};
-const data = JSON.stringify(settings, ["level", "health"]);
+const data = JSON.stringify(settings, ['level', 'health']);
console.log(data);
```
@@ -2120,12 +2126,12 @@ The `Labrador` class receives two arguments, `name` since it extends `Dog`, and
```javascript
// index.js
-console.log("running index.js");
-import { sum } from "./sum.js";
+console.log('running index.js');
+import { sum } from './sum.js';
console.log(sum(1, 2));
// sum.js
-console.log("running sum.js");
+console.log('running sum.js');
export const sum = (a, b) => a + b;
```
@@ -2153,7 +2159,7 @@ This is a difference between `require()` in CommonJS and `import`! With `require
```javascript
console.log(Number(2) === Number(2));
console.log(Boolean(false) === Boolean(false));
-console.log(Symbol("foo") === Symbol("foo"));
+console.log(Symbol('foo') === Symbol('foo'));
```
- A: `true`, `true`, `false`
@@ -2176,7 +2182,7 @@ Every Symbol is entirely unique. The purpose of the argument passed to the Symbo
###### 69. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const name = "Lydia Hallie";
+const name = 'Lydia Hallie';
console.log(name.padStart(13));
console.log(name.padStart(2));
```
@@ -2203,7 +2209,7 @@ If the argument passed to the `padStart` method is smaller than the length of th
###### 70. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-console.log("đĨ" + "đģ");
+console.log('đĨ' + 'đģ');
```
- A: `"đĨđģ"`
@@ -2227,11 +2233,11 @@ With the `+` operator, you can concatenate strings. In this case, we are concate
```javascript
function* startGame() {
- const āĻāϤā§āϤāϰ = yield "Do you love JavaScript?";
- if (āĻāϤā§āϤāϰ !== "Yes") {
+ const āĻāϤā§āϤāϰ = yield 'Do you love JavaScript?';
+ if (āĻāϤā§āϤāϰ !== 'Yes') {
return "Oh wow... Guess we're done here";
}
- return "JavaScript loves you back â¤ī¸";
+ return 'JavaScript loves you back â¤ī¸';
}
const game = startGame();
@@ -2299,7 +2305,7 @@ In this case, the string is `Hello\nworld`, which gets logged.
```javascript
async function getData() {
- return await Promise.resolve("I made it!");
+ return await Promise.resolve('I made it!');
}
const data = getData();
@@ -2336,7 +2342,7 @@ function addToList(item, list) {
return list.push(item);
}
-const result = addToList("apple", ["banana"]);
+const result = addToList('apple', ['banana']);
console.log(result);
```
@@ -2396,7 +2402,7 @@ Since `shape` is frozen, and since the value of `x` is not an object, we cannot
###### 76. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const { firstName: myName } = { firstName: "Lydia" };
+const { firstName: myName } = { firstName: 'Lydia' };
console.log(firstName);
```
@@ -2414,7 +2420,7 @@ console.log(firstName);
By using [destructuring assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) syntax we can unpack values from arrays, or properties from objects, into distinct variables:
```javascript
-const { firstName } = { firstName: "Lydia" };
+const { firstName } = { firstName: 'Lydia' };
// ES5 version:
// var firstName = { firstName: 'Lydia' }.firstName;
@@ -2424,7 +2430,7 @@ console.log(firstName); // "Lydia"
Also, a property can be unpacked from an object and assigned to a variable with a different name than the object property:
```javascript
-const { firstName: myName } = { firstName: "Lydia" };
+const { firstName: myName } = { firstName: 'Lydia' };
// ES5 version:
// var myName = { firstName: 'Lydia' }.firstName;
@@ -2437,7 +2443,7 @@ Therefore, `firstName` does not exist as a variable, thus attempting to access i
**Note:** Be aware of the `global scope` properties:
```javascript
-const { name: myName } = { name: "Lydia" };
+const { name: myName } = { name: 'Lydia' };
console.log(myName); // "lydia"
console.log(name); // "" ----- Browser e.g. Chrome
@@ -2530,7 +2536,7 @@ The third time, we pass `5 * 2` to the function which gets evaluated to `10`. Th
###### 79. What is the output?
```javascript
-const myLifeSummedUp = ["â", "đģ", "đˇ", "đĢ"];
+const myLifeSummedUp = ['â', 'đģ', 'đˇ', 'đĢ'];
for (let item in myLifeSummedUp) {
console.log(item);
@@ -2626,13 +2632,13 @@ In this case, if we didn't pass a value or if we passed `undefined`, `name` woul
###### 82. What is the output?
```javascript
-var status = "đ";
+var status = 'đ';
setTimeout(() => {
- const status = "đ";
+ const status = 'đ';
const data = {
- status: "đĨ",
+ status: 'đĨ',
getStatus() {
return this.status;
},
@@ -2666,12 +2672,12 @@ With the `call` method, we can change the object to which the `this` keyword ref
```javascript
const person = {
- name: "Lydia",
+ name: 'Lydia',
age: 21,
};
let city = person.city;
-city = "Amsterdam";
+city = 'Amsterdam';
console.log(person);
```
@@ -2735,7 +2741,7 @@ Variables with the `const` and `let` keywords are _block-scoped_. A block is any
###### 85. What kind of information would get logged?
```javascript
-fetch("https://www.website.com/api/user/1")
+fetch('https://www.website.com/api/user/1')
.then((res) => res.json())
.then((res) => console.log(res));
```
@@ -2791,7 +2797,7 @@ By setting `hasName` equal to `name`, you set `hasName` equal to whatever value
###### 87. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-console.log("I want pizza"[0]);
+console.log('I want pizza'[0]);
```
- A: `"""`
@@ -2846,11 +2852,11 @@ If you're trying to set a default parameter's value equal to a parameter that is
```javascript
// module.js
-export default () => "Hello world";
-export const name = "Lydia";
+export default () => 'Hello world';
+export const name = 'Lydia';
// index.js
-import * as data from "./module";
+import * as data from './module';
console.log(data);
```
@@ -2883,7 +2889,7 @@ class Person {
}
}
-const member = new Person("John");
+const member = new Person('John');
console.log(typeof member);
```
@@ -2943,7 +2949,7 @@ Then, we try to use the `.push` method on `newList`. Since `newList` is the nume
```javascript
function giveLydiaPizza() {
- return "Here is pizza!";
+ return 'Here is pizza!';
}
const giveLydiaChocolate = () =>
@@ -2974,7 +2980,7 @@ Regular functions, such as the `giveLydiaPizza` function, have a `prototype` pro
```javascript
const person = {
- name: "Lydia",
+ name: 'Lydia',
age: 21,
};
@@ -3034,7 +3040,7 @@ function getItems(fruitList, favoriteFruit, ...args) {
return [...fruitList, ...args, favoriteFruit];
}
-getItems(["banana", "apple"], "pear", "orange");
+getItems(['banana', 'apple'], 'pear', 'orange');
```
The above example works. This returns the array `[ 'banana', 'apple', 'orange', 'pear' ]`
@@ -3048,8 +3054,8 @@ The above example works. This returns the array `[ 'banana', 'apple', 'orange',
```javascript
function nums(a, b) {
- if (a > b) console.log("a is bigger");
- else console.log("b is bigger");
+ if (a > b) console.log('a is bigger');
+ else console.log('b is bigger');
return;
a + b;
}
@@ -3089,13 +3095,13 @@ This means that `a + b` is never reached, since a function stops running after t
```javascript
class Person {
constructor() {
- this.name = "Lydia";
+ this.name = 'Lydia';
}
}
Person = class AnotherPerson {
constructor() {
- this.name = "Sarah";
+ this.name = 'Sarah';
}
};
@@ -3124,7 +3130,7 @@ We can set classes equal to other classes/function constructors. In this case, w
```javascript
const info = {
- [Symbol("a")]: "b",
+ [Symbol('a')]: 'b',
};
console.log(info);
@@ -3193,7 +3199,7 @@ The following function would have returned an object:
###### 99. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const name = "Lydia";
+const name = 'Lydia';
console.log(name());
```
@@ -3225,8 +3231,8 @@ ReferenceErrors get thrown when JavaScript isn't able to find a reference to a v
```javascript
// đ⨠This is my 100th question! â¨đ
-const output = `${[] && "Im"}possible!
-You should${"" && `n't`} see a therapist after so much JavaScript lol`;
+const output = `${[] && 'Im'}possible!
+You should${'' && `n't`} see a therapist after so much JavaScript lol`;
```
- A: `possible! You should see a therapist after so much JavaScript lol`
@@ -3252,7 +3258,7 @@ You should${"" && `n't`} see a therapist after so much JavaScript lol`;
```javascript
const one = false || {} || null;
-const two = null || false || "";
+const two = null || false || '';
const three = [] || 0 || true;
console.log(one, two, three);
@@ -3284,16 +3290,16 @@ With the `||` operator, we can return the first truthy operand. If all values ar
###### 102. What's the value of output?
```javascript
-const myPromise = () => Promise.resolve("I have resolved!");
+const myPromise = () => Promise.resolve('I have resolved!');
function firstFunction() {
myPromise().then((res) => console.log(res));
- console.log("second");
+ console.log('second');
}
async function secondFunction() {
console.log(await myPromise());
- console.log("second");
+ console.log('second');
}
firstFunction();
@@ -3331,8 +3337,8 @@ This means that it waited for the `myPromise` to resolve with the value `I have
const set = new Set();
set.add(1);
-set.add("Lydia");
-set.add({ name: "Lydia" });
+set.add('Lydia');
+set.add({ name: 'Lydia' });
for (let item of set) {
console.log(item + 2);
@@ -3392,13 +3398,13 @@ In this case, we just passed the numerical value `5`. It returns a resolved prom
```javascript
function compareMembers(person1, person2 = person) {
if (person1 !== person2) {
- console.log("Not the same!");
+ console.log('Not the same!');
} else {
- console.log("They are the same!");
+ console.log('They are the same!');
}
}
-const person = { name: "Lydia" };
+const person = { name: 'Lydia' };
compareMembers(person);
```
@@ -3437,7 +3443,7 @@ const colorConfig = {
yellow: false,
};
-const colors = ["pink", "red", "blue"];
+const colors = ['pink', 'red', 'blue'];
console.log(colorConfig.colors[1]);
```
@@ -3466,7 +3472,7 @@ JavaScript interprets (or unboxes) statements. When we use bracket notation, it
###### 107. What's its value?
```javascript
-console.log("â¤ī¸" === "â¤ī¸");
+console.log('â¤ī¸' === 'â¤ī¸');
```
- A: `true`
@@ -3487,14 +3493,14 @@ Under the hood, emojis are unicodes. The unicodes for the heart emoji is `"U+276
###### 108. Which of these methods modifies the original array?
```javascript
-const emojis = ["â¨", "đĨ", "đ"];
+const emojis = ['â¨', 'đĨ', 'đ'];
-emojis.map((x) => x + "â¨");
-emojis.filter((x) => x !== "đĨ");
-emojis.find((x) => x !== "đĨ");
-emojis.reduce((acc, cur) => acc + "â¨");
-emojis.slice(1, 2, "â¨");
-emojis.splice(1, 2, "â¨");
+emojis.map((x) => x + 'â¨');
+emojis.filter((x) => x !== 'đĨ');
+emojis.find((x) => x !== 'đĨ');
+emojis.reduce((acc, cur) => acc + 'â¨');
+emojis.slice(1, 2, 'â¨');
+emojis.splice(1, 2, 'â¨');
```
- A: `All of them`
@@ -3519,10 +3525,10 @@ With `splice` method, we modify the original array by deleting, replacing or add
###### 109. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const food = ["đ", "đĢ", "đĨ", "đ"];
+const food = ['đ', 'đĢ', 'đĨ', 'đ'];
const info = { favoriteFood: food[0] };
-info.favoriteFood = "đ";
+info.favoriteFood = 'đ';
console.log(food);
```
@@ -3576,7 +3582,7 @@ const jsonArray = JSON.stringify([1, 2, 3]); // '[1, 2, 3]'
JSON.parse(jsonArray); // [1, 2, 3]
// Stringifying an object into valid JSON, then parsing the JSON string to a JavaScript value:
-const jsonArray = JSON.stringify({ name: "Lydia" }); // '{"name":"Lydia"}'
+const jsonArray = JSON.stringify({ name: 'Lydia' }); // '{"name":"Lydia"}'
JSON.parse(jsonArray); // { name: 'Lydia' }
```
@@ -3588,11 +3594,11 @@ JSON.parse(jsonArray); // { name: 'Lydia' }
###### 111. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-let name = "Lydia";
+let name = 'Lydia';
function getName() {
console.log(name);
- let name = "Sarah";
+ let name = 'Sarah';
}
getName();
@@ -3615,7 +3621,7 @@ Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, do
If we wouldn't have declared the `name` variable within the `getName` function, the javascript engine would've looked down the _scope chain_. The outer scope has a variable called `name` with the value of `Lydia`. In that case, it would've logged `Lydia`.
```javascript
-let name = "Lydia";
+let name = 'Lydia';
function getName() {
console.log(name);
@@ -3633,11 +3639,11 @@ getName(); // Lydia
```javascript
function* generatorOne() {
- yield ["a", "b", "c"];
+ yield ['a', 'b', 'c'];
}
function* generatorTwo() {
- yield* ["a", "b", "c"];
+ yield* ['a', 'b', 'c'];
}
const one = generatorOne();
@@ -3683,7 +3689,7 @@ console.log(two.next().value); // undefined
###### 113. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-console.log(`${((x) => x)("I love")} to program`);
+console.log(`${((x) => x)('I love')} to program`);
```
- A: `I love to program`
@@ -3708,7 +3714,7 @@ Expressions within template literals are evaluated first. This means that the st
```javascript
let config = {
alert: setInterval(() => {
- console.log("Alert!");
+ console.log('Alert!');
}, 1000),
};
@@ -3740,16 +3746,16 @@ Since it was not cleared, the `setInterval` callback function will still get inv
```javascript
const myMap = new Map();
-const myFunc = () => "greeting";
+const myFunc = () => 'greeting';
-myMap.set(myFunc, "Hello world!");
+myMap.set(myFunc, 'Hello world!');
//1
-myMap.get("greeting");
+myMap.get('greeting');
//2
myMap.get(myFunc);
//3
-myMap.get(() => "greeting");
+myMap.get(() => 'greeting');
```
- A: 1
@@ -3776,14 +3782,14 @@ When adding a key/value pair using the `set` method, the key will be the value o
```javascript
const person = {
- name: "Lydia",
+ name: 'Lydia',
age: 21,
};
const changeAge = (x = { ...person }) => (x.age += 1);
const changeAgeAndName = (x = { ...person }) => {
x.age += 1;
- x.name = "Sarah";
+ x.name = 'Sarah';
};
changeAge(person);
@@ -3842,7 +3848,7 @@ With the spread operator `...`, we can _spread_ iterables to individual elements
```javascript
let num = 1;
-const list = ["đĨŗ", "đ¤ ", "đĨ°", "đ¤Ē"];
+const list = ['đĨŗ', 'đ¤ ', 'đĨ°', 'đ¤Ē'];
console.log(list[(num += 1)]);
```
@@ -3868,11 +3874,11 @@ With the `+=` operator, we're incrementing the value of `num` by `1`. `num` had
```javascript
const person = {
- firstName: "Lydia",
- lastName: "Hallie",
+ firstName: 'Lydia',
+ lastName: 'Hallie',
pet: {
- name: "Mara",
- breed: "Dutch Tulip Hound",
+ name: 'Mara',
+ breed: 'Dutch Tulip Hound',
},
getFullName() {
return `${this.firstName} ${this.lastName}`;
@@ -3910,10 +3916,10 @@ With the optional chaining operator `?.`, we no longer have to explicitly check
###### 120. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const groceries = ["banana", "apple", "peanuts"];
+const groceries = ['banana', 'apple', 'peanuts'];
-if (groceries.indexOf("banana")) {
- console.log("We have to buy bananas!");
+if (groceries.indexOf('banana')) {
+ console.log('We have to buy bananas!');
} else {
console.log(`We don't have to buy bananas!`);
}
@@ -3969,10 +3975,10 @@ The `language` method is a `setter`. Setters don't hold an actual value, their p
###### 122. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const name = "Lydia Hallie";
+const name = 'Lydia Hallie';
-console.log(!typeof name === "object");
-console.log(!typeof name === "string");
+console.log(!typeof name === 'object');
+console.log(!typeof name === 'string');
```
- A: `false` `true`
@@ -4087,14 +4093,14 @@ myFunc(1, 2, 3);
```javascript
function getFine(speed, amount) {
- const formattedSpeed = new Intl.NumberFormat("en-US", {
- style: "unit",
- unit: "mile-per-hour",
+ const formattedSpeed = new Intl.NumberFormat('en-US', {
+ style: 'unit',
+ unit: 'mile-per-hour',
}).format(speed);
- const formattedAmount = new Intl.NumberFormat("en-US", {
- style: "currency",
- currency: "USD",
+ const formattedAmount = new Intl.NumberFormat('en-US', {
+ style: 'currency',
+ currency: 'USD',
}).format(amount);
return `The driver drove ${formattedSpeed} and has to pay ${formattedAmount}`;
@@ -4123,8 +4129,8 @@ With the `Intl.NumberFormat` method, we can format numeric values to any locale.
###### 127. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const spookyItems = ["đģ", "đ", "đ¸"];
-({ item: spookyItems[3] } = { item: "đ" });
+const spookyItems = ['đģ', 'đ', 'đ¸'];
+({ item: spookyItems[3] } = { item: 'đ' });
console.log(spookyItems);
```
@@ -4149,7 +4155,7 @@ By destructuring objects, we can unpack values from the right-hand object, and a
###### 128. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const name = "Lydia Hallie";
+const name = 'Lydia Hallie';
const age = 21;
console.log(Number.isNaN(name));
@@ -4185,7 +4191,7 @@ const randomValue = 21;
function getInfo() {
console.log(typeof randomValue);
- const randomValue = "Lydia Hallie";
+ const randomValue = 'Lydia Hallie';
}
getInfo();
@@ -4211,7 +4217,7 @@ Variables declared with the `const` keyword are not referenceable before their i
###### 130. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const myPromise = Promise.resolve("Woah some cool data");
+const myPromise = Promise.resolve('Woah some cool data');
(async () => {
try {
@@ -4219,7 +4225,7 @@ const myPromise = Promise.resolve("Woah some cool data");
} catch {
throw new Error(`Oops didn't work`);
} finally {
- console.log("Oh finally!");
+ console.log('Oh finally!');
}
})();
```
@@ -4244,7 +4250,7 @@ In the `try` block, we're logging the awaited value of the `myPromise` variable:
###### 131. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const emojis = ["đĨ", ["â¨", "â¨", ["đ", "đ"]]];
+const emojis = ['đĨ', ['â¨', 'â¨', ['đ', 'đ']]];
console.log(emojis.flat(1));
```
@@ -4317,19 +4323,19 @@ We invoke `counterTwo.increment()`, which sets `count` to `3`. Then, we log the
###### 133. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const myPromise = Promise.resolve(Promise.resolve("Promise"));
+const myPromise = Promise.resolve(Promise.resolve('Promise'));
function funcOne() {
- setTimeout(() => console.log("Timeout 1!"), 0);
+ setTimeout(() => console.log('Timeout 1!'), 0);
myPromise.then((res) => res).then((res) => console.log(`${res} 1!`));
- console.log("Last line 1!");
+ console.log('Last line 1!');
}
async function funcTwo() {
const res = await myPromise;
console.log(`${res} 2!`);
- setTimeout(() => console.log("Timeout 2!"), 0);
- console.log("Last line 2!");
+ setTimeout(() => console.log('Timeout 2!'), 0);
+ console.log('Last line 2!');
}
funcOne();
@@ -4374,7 +4380,7 @@ export default function sum(x) {
}
// index.js
-import * as sum from "./sum";
+import * as sum from './sum';
```
- A: `sum(4)`
@@ -4391,12 +4397,12 @@ With the asterisk `*`, we import all exported values from that file, both defaul
```javascript
// info.js
-export const name = "Lydia";
+export const name = 'Lydia';
export const age = 21;
-export default "I love JavaScript";
+export default 'I love JavaScript';
// index.js
-import * as info from "./info";
+import * as info from './info';
console.log(info);
```
@@ -4427,13 +4433,13 @@ We can invoke this function, by calling `sum.default`
```javascript
const handler = {
- set: () => console.log("Added a new property!"),
- get: () => console.log("Accessed a property!"),
+ set: () => console.log('Added a new property!'),
+ get: () => console.log('Accessed a property!'),
};
const person = new Proxy({}, handler);
-person.name = "Lydia";
+person.name = 'Lydia';
person.name;
```
@@ -4463,7 +4469,7 @@ Then, we access a property value on the proxy object, and the `get` property on
###### 136. Which of the following will modify the `person` object?
```javascript
-const person = { name: "Lydia Hallie" };
+const person = { name: 'Lydia Hallie' };
Object.seal(person);
```
@@ -4491,9 +4497,9 @@ However, you can still modify the value of existing properties.
```javascript
const person = {
- name: "Lydia Hallie",
+ name: 'Lydia Hallie',
address: {
- street: "100 Main St",
+ street: '100 Main St',
},
};
@@ -4593,8 +4599,8 @@ In ES2020, we can add private variables in classes by using the `#`. We cannot a
```javascript
const teams = [
- { name: "Team 1", members: ["Paul", "Lisa"] },
- { name: "Team 2", members: ["Laura", "Tim"] },
+ { name: 'Team 1', members: ['Paul', 'Lisa'] },
+ { name: 'Team 2', members: ['Laura', 'Tim'] },
];
function* getMembers(members) {
@@ -4637,8 +4643,8 @@ If we would've written `yield`, `return yield`, or `return`, the entire generato
```javascript
const person = {
- name: "Lydia Hallie",
- hobbies: ["coding"],
+ name: 'Lydia Hallie',
+ hobbies: ['coding'],
};
function addHobby(hobby, hobbies = person.hobbies) {
@@ -4646,9 +4652,9 @@ function addHobby(hobby, hobbies = person.hobbies) {
return hobbies;
}
-addHobby("running", []);
-addHobby("dancing");
-addHobby("baking", person.hobbies);
+addHobby('running', []);
+addHobby('dancing');
+addHobby('baking', person.hobbies);
console.log(person.hobbies);
```
@@ -4717,11 +4723,11 @@ We create the variable `pet` which is an instance of the `Flamingo` class. When
###### 143. Which of the options result(s) in an error?
```javascript
-const emojis = ["đ", "đ
đŧ", "đ", "â"];
+const emojis = ['đ', 'đ
đŧ', 'đ', 'â'];
-/* 1 */ emojis.push("đĻ");
+/* 1 */ emojis.push('đĻ');
/* 2 */ emojis.splice(0, 2);
-/* 3 */ emojis = [...emojis, "đĨ"];
+/* 3 */ emojis = [...emojis, 'đĨ'];
/* 4 */ emojis.length = 0;
```
@@ -4807,9 +4813,9 @@ function getFruit(fruits) {
console.log(fruits?.[1]?.[1]);
}
-getFruit([["đ", "đ"], ["đ"]]);
+getFruit([['đ', 'đ'], ['đ']]);
getFruit();
-getFruit([["đ"], ["đ", "đ"]]);
+getFruit([['đ'], ['đ', 'đ']]);
```
- A: `null`, `undefined`, đ
@@ -4875,8 +4881,8 @@ We set the variable `calc` equal to a new instance of the `Calc` class. Then, we
```javascript
const user = {
- email: "e@mail.com",
- password: "12345",
+ email: 'e@mail.com',
+ password: '12345',
};
const updateUser = ({ email, password }) => {
@@ -4891,7 +4897,7 @@ const updateUser = ({ email, password }) => {
return user;
};
-const updatedUser = updateUser({ email: "new@email.com" });
+const updatedUser = updateUser({ email: 'new@email.com' });
console.log(updatedUser === user);
```
@@ -4916,11 +4922,11 @@ The `updateUser` function updates the values of the `email` and `password` prope
###### 149. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const fruit = ["đ", "đ", "đ"];
+const fruit = ['đ', 'đ', 'đ'];
fruit.slice(0, 1);
fruit.splice(0, 1);
-fruit.unshift("đ");
+fruit.unshift('đ');
console.log(fruit);
```
@@ -4948,11 +4954,11 @@ At last, we invoke the `unshift` method on the `fruit` array, which modifies the
```javascript
const animals = {};
-let dog = { emoji: "đļ" };
-let cat = { emoji: "đ" };
+let dog = { emoji: 'đļ' };
+let cat = { emoji: 'đ' };
-animals[dog] = { ...dog, name: "Mara" };
-animals[cat] = { ...cat, name: "Sara" };
+animals[dog] = { ...dog, name: 'Mara' };
+animals[cat] = { ...cat, name: 'Sara' };
console.log(animals[dog]);
```
@@ -4984,13 +4990,13 @@ Logging `animals[dog]`, or actually `animals["[object Object]"]` since convertin
```javascript
const user = {
- email: "my@email.com",
+ email: 'my@email.com',
updateEmail: (email) => {
this.email = email;
},
};
-user.updateEmail("new@email.com");
+user.updateEmail('new@email.com');
console.log(user.email);
```
@@ -5014,10 +5020,10 @@ The `updateEmail` function is an arrow function, and is not bound to the `user`
###### 152. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const promise1 = Promise.resolve("First");
-const promise2 = Promise.resolve("Second");
-const promise3 = Promise.reject("Third");
-const promise4 = Promise.resolve("Fourth");
+const promise1 = Promise.resolve('First');
+const promise2 = Promise.resolve('Second');
+const promise3 = Promise.reject('Third');
+const promise4 = Promise.resolve('Fourth');
const runPromises = async () => {
const res1 = await Promise.all([promise1, promise2]);
@@ -5050,8 +5056,8 @@ The `Promise.all` method runs the passed promises in parallel. If one promise fa
###### 153. What should the value of `method` be to log `{ name: "Lydia", age: 22 }`?
```javascript
-const keys = ["name", "age"];
-const values = ["Lydia", 22];
+const keys = ['name', 'age'];
+const values = ['Lydia', 22];
const method =
/* ?? */
@@ -5086,7 +5092,7 @@ This creates an array of subarrays containing the correct keys and values, which
```javascript
const createMember = ({ email, address = {} }) => {
const validEmail = /.+\@.+\..+/.test(email);
- if (!validEmail) throw new Error("Valid email pls");
+ if (!validEmail) throw new Error('Valid email pls');
return {
email,
@@ -5094,7 +5100,7 @@ const createMember = ({ email, address = {} }) => {
};
};
-const member = createMember({ email: "my@email.com" });
+const member = createMember({ email: 'my@email.com' });
console.log(member);
```
@@ -5118,10 +5124,10 @@ The default value of `address` is an empty object `{}`. When we set the variable
###### 155. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-let randomValue = { name: "Lydia" };
+let randomValue = { name: 'Lydia' };
randomValue = 23;
-if (!typeof randomValue === "string") {
+if (!typeof randomValue === 'string') {
console.log("It's not a string!");
} else {
console.log("Yay it's a string!");
From 70d1278b545d1218964b3e6555947f91d366dc5a Mon Sep 17 00:00:00 2001
From: iamsaief
Date: Thu, 23 May 2024 04:09:10 +0600
Subject: [PATCH 03/12] added translation till 50
---
bn-BD/README_bn-BD.md | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/bn-BD/README_bn-BD.md b/bn-BD/README_bn-BD.md
index d9a00cf2..6eb10aab 100644
--- a/bn-BD/README_bn-BD.md
+++ b/bn-BD/README_bn-BD.md
@@ -1397,7 +1397,7 @@ Promise.race([firstPromise, secondPromise]).then((res) => console.log(res));
#### āĻāϤā§āϤāϰ: B
-When we pass multiple promises to the `Promise.race` method, it resolves/rejects the _first_ promise that resolves/rejects. To the `setTimeout` method, we pass a timer: 500ms for the first promise (`firstPromise`), and 100ms for the second promise (`secondPromise`). This means that the `secondPromise` resolves first with the value of `'two'`. `res` now holds the value of `'two'`, which gets logged.
+āϝāĻāύ `Promise.race` āĻŽā§āĻĨāĻĄā§ āĻāĻŽāϰāĻž āĻāĻāĻžāϧāĻŋāĻ āĻĒā§āϰā§āĻŽāĻŋāϏ āĻĒāĻžāϏ āĻāϰāĻŋ, _ā§§āĻŽ_ āϝ⧠āĻĒā§āϰāĻŽāĻŋāϏāĻāĻŋ āϰāĻŋāϏāϞāĻ/āϰāĻŋāĻā§āĻā§āĻ āĻšā§ āϤāĻžāĻā§āĻ āĻāĻāĻž āϰāĻŋāϏāϞāĻ/āϰāĻŋāĻā§āĻā§āĻ āĻāϰā§āĨ¤ `setTimeout` āĻŽā§āĻĨāĻĄā§ āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ āĻāĻžāĻāĻŽāĻžāϰ āĻĒāĻžāϏ āĻāϰā§āĻāĻŋāĻ ā§§āĻŽ āĻĒā§āϰāĻŽāĻŋāϏ⧠(`firstPromise`) 500ms āĻāĻŦāĻ ā§¨ā§ āĻĒā§āϰāĻŽāĻŋāϏ⧠(`secondPromise`) 100msāĨ¤ āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ, `secondPromise`āĻāĻŋ `'two'` āĻā§āϝāĻžāϞ⧠āύāĻŋā§ā§ āĻĒā§āϰāĻĨāĻŽā§ āϰāĻŋāĻāϞāĻ āĻšā§āĨ¤ āϤāĻžāĻ `res` āĻāϰ āĻā§āϝāĻžāϞā§āĻāĻŋāĻ (`'two'`) āϞāĻ āĻšāĻā§āĻā§āĨ¤
@@ -1424,19 +1424,19 @@ console.log(members);
#### āĻāϤā§āϤāϰ: D
-First, we declare a variable `person` with the value of an object that has a `name` property.
+ā§§āĻŽā§, āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞ `person` āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰā§āĻāĻŋ, āĻāĻāĻŋ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻ āϝāĻžāϰ āĻāĻāĻāĻŋ `name` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ (āĻāĻŋ) āĻāĻā§āĨ¤
-Then, we declare a variable called `members`. We set the first element of that array equal to the value of the `person` variable. Objects interact by _reference_ when setting them equal to each other. When you assign a reference from one variable to another, you make a _copy_ of that reference. (note that they don't have the _same_ reference!)
+āϤāĻžāϰāĻĒāϰ āĻāĻŽāϰāĻž āĻāϰāĻ āĻāĻāĻāĻŋ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞ āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰā§āĻāĻŋ `members` āύāĻžāĻŽā§āĨ¤ āĻāĻāĻŋ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āϝāĻžāϰ ā§§āĻŽ āĻāύāĻĄā§āĻā§āϏāĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āĻšāĻā§āĻā§ `person` āĻā§āϝāĻžāϰāĻŋā§ā§āϞāĻŦāĻāĻŋāĨ¤ āϝāĻāύ āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āĻāĻā§ āĻāĻĒāϰā§āϰ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻž āĻšā§ āĻāϰāĻž _āϰā§āĻĢāĻžāϰā§āύā§āϏ_ āĻāϰ āĻŽāĻžāϧā§āϝāĻŽā§ āĻāĻžāĻ āĻāϰā§āĨ¤ āϝāĻāύ āĻāĻĒāύāĻŋ āĻāĻāĻāĻŋ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻā§ āĻ
ā§āϝāĻžāϏāĻžāĻāύ āĻāϰāĻā§āύ āĻ
āύā§āϝ āĻā§āϝāϰāĻŋā§ā§āĻŦāϞā§āϰ āϰā§āĻĢāĻžāϰā§āύā§āϏ, āĻāĻĒāύāĻŋ āĻāϏāϞ⧠āĻ āϰā§āĻĢāĻžāϰā§āύā§āϏā§āϰ āĻāĻāĻāĻŋ _āĻāĻĒāĻŋ_ āĻāϰāĻā§āύāĨ¤ _āĻŽāύ⧠āϰāĻžāĻāĻŦā§āύ āϤāĻžāĻĻā§āϰ āĻāĻžāĻā§ āĻāĻŋāύā§āϤ⧠āĻāĻāĻ āϰā§āĻĢāĻžāϰā§āύā§āϏ āύā§āĻ_ !
-Then, we set the variable `person` equal to `null`.
+āĻĒāϰāĻŦāϰā§āϤāĻŋāϤ⧠`person` āĻā§āϝāĻžā§ā§āĻŦāϞāĻā§ āĻāĻŽāϰāĻž āϏā§āĻ āĻāϰāĻāĻŋ āϏāĻŽāĻžāύ āϏāĻŽāĻžāύ `null`āĨ¤
-We are only modifying the value of the `person` variable, and not the first element in the array, since that element has a different (copied) reference to the object. The first element in `members` still holds its reference to the original object. When we log the `members` array, the first element still holds the value of the object, which gets logged.
+āĻāĻŽāϰāĻž āĻā§āĻŦāϞ `person` āĻā§āϝāĻžā§ā§āĻŦāϞāĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§āĻāĻŋ, āĻ
ā§āϝāĻžāϰā§āϰ ā§§āĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻāĻā§ āύā§, āϝā§āĻšā§āϤ⧠āĻ āĻāϞāĻŋāĻŽā§āύā§āĻāĻŋāϰ āĻāĻžāĻā§ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻāĻŋāύā§āύ (āĻāĻĒāĻŋāĻā§āϤ) āĻāĻāĻāĻŋ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāĻā§āĨ¤ `members` āĻ
ā§āϝāĻžāϰā§āϰ ā§§āĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻāĻāĻŋ āĻāĻāύ⧠āĻāϏāϞ āĻ
āĻŦāĻā§āĻā§āĻāĻŋāϰ āϰā§āĻĢāĻžāϰā§āύā§āϏāĻāĻŋ āϧāϰ⧠āϰā§āĻā§āĻā§ āϤāĻžāĻ ā§§āĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻāĻāĻŋ āϤāĻžāϰ āĻā§āϝāĻžāϞā§āĻ āϧāϰ⧠āϰā§āĻā§āĻā§ āĻāϏāϞ āĻ
āĻŦāĻā§āĻā§āĻāĻŋāϰ āĻā§āϝāĻžāϞā§āĻā§āĻāĨ¤ āĻĢāϞ⧠āϝāĻāύ `members` āĻ
ā§āϝāĻžāϰā§āĻā§ āϞāĻ āĻāϰāĻž āĻšā§ āϏā§āĻāĻžāĻ āϞāĻ āĻšā§ā§āĻā§āĨ¤
@@ -1466,7 +1466,7 @@ for (const item in person) {
#### āĻāϤā§āϤāϰ: B
-With a `for-in` loop, we can iterate through object keys, in this case `name` and `age`. Under the hood, object keys are strings (if they're not a Symbol). On every loop, we set the value of `item` equal to the current key itâs iterating over. First, `item` is equal to `name`, and gets logged. Then, `item` is equal to `age`, which gets logged.
+`for-in` āϞā§āĻĒ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻāĻŽāϰāĻž āĻā§āĻŦāϞ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻāĻŋ-āĻā§āϞāĻŋāϰ āĻŽāϧā§āϝā§āĻ āĻĒā§āύāϰāĻžāĻŦā§āϤā§āϤāĻŋ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ, āĻāĻā§āώā§āϤā§āϰ⧠`name` āĻ `age`āĨ¤ āĻā§āϤāϰ⧠āĻā§āϤāϰ⧠āĻ
āĻŦāĻā§āĻā§āĻ āĻā§āĻā§āϞāĻŋ āĻšāϞ āϏā§āĻā§āϰāĻŋāĻ (āϝāĻĻāĻŋ āϤāĻžāϰāĻž āĻā§āύ āĻāĻāĻāĻŋ āĻĒā§āϰāϤā§āĻ (Symbol) āύāĻž āĻšāϝāĻŧ)āĨ¤ āĻĒā§āϰāϤāĻŋāĻāĻŋ āϞā§āĻĒā§, āĻāĻŽāϰāĻž `item` āĻŽāĻžāύāĻāĻŋ āĻŦāϰā§āϤāĻŽāĻžāύ āĻā§-āĻāĻŋāϰ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻŋ āϝāĻžāϰ āĻĒā§āύāϰāĻžāĻŦā§āϤā§āϤāĻŋ āĻšāĻā§āĻā§āĨ¤ ā§§āĻŽā§, `item`-āĻāĻŋ `name`-āĻāϰ āϏāĻŽāĻžāύ, āĻāĻŦāĻ āϞāĻ āĻāϰāĻž āĻšāϝāĻŧāĨ¤ āϤāĻžāϰāĻĒāϰ, `item`-āĻāĻŋ `age`-āĻāϰ āϏāĻŽāĻžāύ, āϝāĻž āϞāĻ āĻšāϝāĻŧāĨ¤
@@ -1489,18 +1489,18 @@ console.log(3 + 4 + '5');
#### āĻāϤā§āϤāϰ: B
-Operator associativity is the order in which the compiler evaluates the expressions, either left-to-right or right-to-left. This only happens if all operators have the _same_ precedence. We only have one type of operator: `+`. For addition, the associativity is left-to-right.
+**āĻ
āĻĒāĻžāϰā§āĻāϰ āĻ
ā§āϝāĻžāϏā§āϏāĻŋāϝāĻŧā§āĻāĻŋāĻāĻŋāĻāĻŋ** āĻšāϞ āϏā§āĻ āĻā§āϰāĻŽ āϝā§āĻāĻžāύ⧠āĻāĻŽā§āĻĒāĻžāĻāϞāĻžāϰ āĻŦāĻžāĻŽ-āĻĨā§āĻā§-āĻĄāĻžāύ āĻŦāĻž āĻĄāĻžāύ-āĻĨā§āĻā§-āĻŦāĻžāĻŽā§ āĻāĻā§āϏāĻĒā§āϰā§āĻļāύāĻā§ āĻŽā§āϞā§āϝāĻžāϝāĻŧāύ āĻāϰā§āĨ¤ āĻāĻāĻŋ āĻļā§āϧā§āĻŽāĻžāϤā§āϰ āϤāĻāύāĻ āĻāĻā§ āϝāĻāύ āϏāĻŽāϏā§āϤ āĻ
āĻĒāĻžāϰā§āĻāϰā§āϰ _āĻāĻāĻ_ āĻ
āĻā§āϰāĻžāϧāĻŋāĻāĻžāϰ āĻĨāĻžāĻā§āĨ¤ āĻāĻŽāĻžāĻĻā§āϰ āĻļā§āϧā§āĻŽāĻžāϤā§āϰ āĻāĻ āϧāϰāύā§āϰ āĻ
āĻĒāĻžāϰā§āĻāϰ āĻāĻā§: `+`āĨ¤ āĻāĻĒāϰāύā§āϤā§, āĻ
ā§āϝāĻžāϏā§āϏāĻŋāϝāĻŧā§āĻāĻŋāĻāĻŋāĻāĻŋ āĻŦāĻžāĻŽ āĻĨā§āĻā§ āĻĄāĻžāύāĨ¤
-`3 + 4` gets evaluated first. This results in the number `7`.
+ā§§āĻŽā§ `3 + 4` āĻŽā§āϞā§āϝāĻžāϝāĻŧāύ āĻāϰāĻž āĻšāϝāĻŧāĨ¤ āĻāϰ āĻĢāϞ⧠āϏāĻāĻā§āϝāĻžāĻāĻŋ `7` āĻšāϝāĻŧāĨ¤
-`7 + '5'` results in `"75"` because of coercion. JavaScript converts the number `7` into a string, see question 15. We can concatenate two strings using the `+`operator. `"7" + "5"` results in `"75"`.
+**āĻā§ā§āĻžāϰā§āĻļāύ** āĻāϰ āĻĢāϞ⧠`7 + '5'` āĻāϰ āĻĢāϞāĻžāĻĢāϞ āĻšā§ `"75"`āĨ¤ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ `7` āύāĻŽā§āĻŦāϰāĻāĻŋāĻā§ āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻāϝāĻŧā§ āϰā§āĻĒāĻžāύā§āϤāϰ āĻāϰā§, [āĻĒā§āϰāĻļā§āύ 15 āĻĻā§āĻā§āύ](#15-āĻāĻāĻžāϰ-āĻāĻāĻāĻĒā§āĻ-āĻā§āύāĻāĻž)āĨ¤ āĻāĻŽāϰāĻž `+` āĻ
āĻĒāĻžāϰā§āĻāϰ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻĻā§āĻāĻŋ āϏā§āĻā§āϰāĻŋāĻāĻā§ āϏāĻāϝā§āĻā§āϤ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ `"7" + "5"` āĻĢāϞāĻžāĻĢāϞ⧠`"75"`āĨ¤
---
-###### 49. What's the value of `num`?
+###### 49. `num` āĻāϰ āĻā§āϝāĻžāϞ⧠āĻā§āύāĻāĻŋ?
```javascript
const num = parseInt('7*6', 10);
@@ -1516,9 +1516,9 @@ const num = parseInt('7*6', 10);
#### āĻāϤā§āϤāϰ: C
-Only the first number in the string is returned. Based on the _radix_ (the second argument in order to specify what type of number we want to parse it to: base 10, hexadecimal, octal, binary, etc.), the `parseInt` checks whether the characters in the string are valid. Once it encounters a character that isn't a valid number in the radix, it stops parsing and ignores the following characters.
+āϏā§āĻā§āϰāĻŋāĻ āĻāϰ āĻļā§āϧā§āĻŽāĻžāϤā§āϰ āĻĒā§āϰāĻĨāĻŽ āϏāĻāĻā§āϝāĻžāĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻšā§ā§āĻā§āĨ¤ _radix_ āĻāϰ āĻāĻĒāϰ āĻāĻŋāϤā§āϤāĻŋ āĻāϰ⧠āϏā§āĻā§āϰāĻŋāĻ-āĻāϰ āĻ
āĻā§āώāϰāĻā§āϞāĻŋ āĻŦā§āϧ āĻāĻŋāύāĻž āϤāĻž āĻĒāϰā§āĻā§āώāĻž āĻāϰ⧠(⧍⧠āĻāϰā§āĻā§āĻŽā§āύā§āĻāĻ āύāĻŋāϰā§āĻĻāĻŋāώā§āĻ āĻāϰ⧠āĻāĻŽāϰāĻž āĻā§āύ āϧāϰāύā§āϰ āϏāĻāĻā§āϝāĻžāĻā§ āĻĒāĻžāϰā§āϏ āĻāϰāϤ⧠āĻāĻžāĻ: āĻĄā§āϏāĻŋāĻŽāĻžāϞ - 10, āĻšā§āĻā§āϏāĻžāĻĄā§āϏāĻŋāĻŽāĻžāϞ - 16, āĻ
āĻā§āĻāĻžāϞ - 8, āĻŦāĻžāĻāύāĻžāϰāĻŋ - 2, āĻāϤā§āϝāĻžāĻĻāĻŋ)āĨ¤ āĻāĻāĻŋ āϝāĻāύ āĻāĻāĻŦāĻžāϰ āĻāĻŽāύ āĻāĻāĻāĻŋ āĻ
āĻā§āώāϰā§āϰ āĻŽā§āĻā§āĻŽā§āĻāĻŋ āĻšāϝāĻŧ āϝāĻž āϰā§āĻĄāĻŋāĻā§āϏ⧠āĻāĻāĻāĻŋ āĻŦā§āϧ āϏāĻāĻā§āϝāĻž āύāϝāĻŧ, āϤāĻāύ āĻĒāĻžāϰā§āϏāĻŋāĻ āĻŦāύā§āϧ āĻāϰ⧠āĻĻā§ā§ āĻāĻŦāĻ āĻĒāϰāĻŦāϰā§āϤāĻŋ āĻ
āĻā§āώāϰāĻā§āϞāĻŋāĻā§ āĻāĻĒā§āĻā§āώāĻž āĻāϰā§āĨ¤
-`*` is not a valid number. It only parses `"7"` into the decimal `7`. `num` now holds the value of `7`.
+`*` āĻāĻāĻāĻŋ āĻŦā§āϧ āϏāĻāĻā§āϝāĻž āύāϝāĻŧāĨ¤ āĻāĻāĻŋ āĻļā§āϧā§āĻŽāĻžāϤā§āϰ `"7"` āĻā§ āĻĄā§āϏāĻŋāĻŽāĻžāϞ `7`-āĻ āĻĒāĻžāϰā§āϏ āĻāϰā§āĨ¤ `num` āĻŽāĻžāύ āϤāĻžāĻ `7`āĨ¤
@@ -1544,9 +1544,9 @@ Only the first number in the string is returned. Based on the _radix_ (the secon
#### āĻāϤā§āϤāϰ: C
-When mapping over the array, the value of `num` is equal to the element itâs currently looping over. In this case, the elements are numbers, so the condition of the if statement `typeof num === "number"` returns `true`. The map function creates a new array and inserts the values returned from the function.
+āĻ
ā§āϝāĻžāϰā§āϰ āĻāĻĒāϰ āĻŽā§āϝāĻžāĻĒāĻŋāĻ āĻāϰāĻžāϰ āϏāĻŽāϝāĻŧ, `num` āĻāϰ āĻŽāĻžāύāĻāĻŋ āĻŦāϰā§āϤāĻŽāĻžāύ⧠āϞā§āĻĒ āĻāϰāĻž āĻšāĻā§āĻā§ āϏā§āĻ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āϏāĻŽāĻžāύāĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰā§, āĻāϞāĻŋāĻŽā§āύā§āĻāĻā§āϞ⧠āϏāĻāĻā§āϝāĻž, āϤāĻžāĻ if āϏā§āĻā§āĻāĻŽā§āύā§āĻā§āϰ āĻļāϰā§āϤāĻāĻŋ`typeof num === "number"` - `true` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ āĻŽā§āϝāĻžāĻĒ āĻĢāĻžāĻāĻļāύ āĻāĻāĻāĻŋ āύāϤā§āύ āĻ
ā§āϝāĻžāϰ⧠āϤā§āϰāĻŋ āĻāϰ⧠āĻāĻŦāĻ āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻā§āϝāĻžāϞā§āĻā§āϞ⧠āϏā§āĻāĻžāϤ⧠āϝā§āĻā§āϤ āĻāϰā§āĨ¤
-However, we donât return a value. When we donât return a value from the function, the function returns `undefined`. For every element in the array, the function block gets called, so for each element we return `undefined`.
+āĻ
āύā§āϝāĻĻāĻŋāĻā§, āĻāĻŽāϰāĻž āĻā§āύ āĻā§āϝāĻžāϞā§āĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻŋ āύāĻŋāĨ¤ āϝāĻāύ āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ āĻā§āύ āĻāĻāĻāĻŋ āĻā§āϝāĻžāϞ⧠āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻšā§ āύāĻž, āĻĢāĻžāĻāĻļāύ `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ āĻ
ā§āϝāĻžāϰā§āϰ āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āĻāύā§āϝ, āĻĢāĻžāĻāĻļāύ āĻŦā§āϞāĻ āĻāϞ āĻāϰāĻž āĻšāϝāĻŧ, āϤāĻžāĻ āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āĻāύā§āϝ āĻāĻŽāϰāĻž `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻāĻŋāĨ¤
From 5a217b412b30c94ac2e01c7ca0808572fd6f242c Mon Sep 17 00:00:00 2001
From: iamsaief
Date: Mon, 27 May 2024 04:54:03 +0600
Subject: [PATCH 04/12] added translation till 65
---
bn-BD/README_bn-BD.md | 80 +++++++++++++++++++++----------------------
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/bn-BD/README_bn-BD.md b/bn-BD/README_bn-BD.md
index 6eb10aab..1f798452 100644
--- a/bn-BD/README_bn-BD.md
+++ b/bn-BD/README_bn-BD.md
@@ -1579,11 +1579,11 @@ console.log(person, birthYear);
#### āĻāϤā§āϤāϰ: A
-Arguments are passed by _value_, unless their value is an object, then they're passed by _reference_. `birthYear` is passed by value, since it's a string, not an object. When we pass arguments by value, a _copy_ of that value is created (see question 46).
+āĻāϰā§āĻā§āĻŽā§āύā§āĻāϏāĻā§āϞ⧠āĻšāϞ āĻĒāĻžāϏāĻĄ āĻŦāĻžāĻ _āĻā§āϝāĻžāϞā§_, āϝāĻĻāĻŋ āύāĻž āϤāĻžāϰāĻž āĻ
āĻŦāĻā§āĻā§āĻ āĻšā§, āϤāĻŦā§ āϤāĻžāϰāĻž āĻĒāĻžāϏāĻĄ āĻŦāĻžāĻ _āϰā§āĻĢāĻžāϰā§āύā§āϏ_āĨ¤ āϝā§āĻšā§āϤ⧠`birthYear` āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ āĻāĻāĻŋ āĻĒāĻžāϏāĻĄ āĻŦāĻžāĻ āĻā§āϝāĻžāϞā§āĨ¤ āϝāĻāύ āĻāĻŽāϰāĻž āĻāϰā§āĻā§āĻŽā§āύā§āĻāϏāĻā§āϞ⧠āĻĒāĻžāϏ āĻāϰāĻŋ _āĻā§āϝāĻžāϞā§_ āĻšāĻŋāϏā§āĻŦā§, āĻ āĻā§āϝāĻžāϞā§āϰ āĻāĻāĻāĻŋ _āĻāĻĒāĻŋ_ āϤā§āϰāĻŋ āĻšā§āĨ¤ [(āĻĒā§āϰāĻļā§āύ ā§Ēā§Ŧ āĻĻā§āĻā§āύ)](#46-āĻāĻāĻžāϰ-āĻāĻāĻāĻĒā§āĻ-āĻā§āύāĻāĻž)
-The variable `birthYear` has a reference to the value `"1997"`. The argument `year` also has a reference to the value `"1997"`, but it's not the same value as `birthYear` has a reference to. When we update the value of `year` by setting `year` equal to `"1998"`, we are only updating the value of `year`. `birthYear` is still equal to `"1997"`.
+`birthYear` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻāĻŋāϰ āĻāĻžāĻā§ `"1997"` āĻā§āϝāĻžāϞā§āϰ āĻāĻāĻāĻŋ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāĻā§āĨ¤ `year` āĻāϰā§āĻā§āĻŽā§āύā§āĻā§āϰ āĻāĻžāĻā§āĻ `"1997"` āĻā§āϝāĻžāϞā§āϰ āĻāĻāĻāĻŋ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāĻā§, āĻāĻŋāύā§āϤ⧠āĻĻā§āĻāĻŋ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāĻāĻŋ āύā§āĨ¤ āĻŽāĻžāύ⧠āĻšāϞ, āĻĢāĻžāĻāĻļāύā§āϰ āĻā§āϤāϰ⧠āĻāĻŽāϰāĻž āϝāĻāύ `year` āĻāϰ āĻā§āϝāĻžāϞā§āĻā§ āĻāĻĒāĻĄā§āĻ āĻāϰāĻāĻŋ `"1998"` āĻāϰ āϏāĻŽāĻžāύ āĻāϰā§, āĻāĻŽāϰāĻž āĻā§āĻŦāϞ `year` āĻāϰ āĻā§āϝāĻžāϞāĻŋāĻāĻŋāĻ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāĻāĻŋāĨ¤ `birthYear` āĻāϰ āĻā§āϝāĻžāϞ⧠āĻāĻāύ⧠āϏāĻŽāĻžāύ āĻšāĻā§āĻā§ `"1997"`āĨ¤
-The value of `person` is an object. The argument `member` has a (copied) reference to the _same_ object. When we modify a property of the object `member` has a reference to, the value of `person` will also be modified, since they both have a reference to the same object. `person`'s `name` property is now equal to the value `"Lydia"`
+āĻ
āύā§āϝāĻĻāĻŋāĻā§, `person` āĻšāϞ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻāĨ¤ āĻāĻ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻĒāĻžāϏ āĻšā§ā§āĻā§ `member` āĻāϰā§āĻā§āĻŽā§āύā§āĻāĻŋāĻāĻŋāϰ āĻāĻžāĻā§āĨ¤ āϝāĻāύ āĻāĻŽāϰāĻž āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻā§āύ āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋāĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāĻāĻŋ āϝā§āĻāĻžāϰ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāĻā§ `member` āĻāϰ āĻāĻžāĻā§, āϤāĻžāĻ `person` āĻ
āĻŦāĻā§āĻā§āĻāĻ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻšāĻā§āĻā§ āϝāĻžāĻā§āĻā§āĨ¤ āϝā§āĻšā§āϤ⧠āϤāĻžāĻĻā§āϰ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāĻāĻāĨ¤ āĻĢāϞ⧠`person`-āĻāϰ `name` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻāĻŋ āĻāĻāύ āϏāĻŽāĻžāύ āĻšāϞ `"Lydia"`āĨ¤
@@ -1619,9 +1619,9 @@ sayHi();
#### āĻāϤā§āϤāϰ: D
-With the `throw` statement, we can create custom errors. With this statement, you can throw exceptions. An exception can be a string, a number, a boolean or an object. In this case, our exception is the string `'Hello world!'`.
+`throw` āϏā§āĻā§āĻāĻŽā§āύā§āĻ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻāĻŽāϰāĻž āĻāĻžāϏā§āĻāĻŽ āĻāϰāϰāϏ āϤā§āϰāĻŋ āĻāϰ⧠āĻāĻā§āϏāϏā§āĻĒāĻļāύ āĻĨā§āϰ⧠āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻāĻā§āϏāϏā§āĻĒāĻļāύāϏ āĻšāϤ⧠āĻĒāĻžāϰ⧠**string**, **number**, **boolean**, āĻ
āĻĨāĻŦāĻž āĻāĻāĻāĻŋ **āĻ
āĻŦāĻā§āĻā§āĻ** āĨ¤ āĻāĻā§āώā§āϤā§āϰā§, āĻāĻā§āϏāϏā§āĻĒāĻļāύ āĻšāϞ āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ `'Hello world!'`āĨ¤
-With the `catch` statement, we can specify what to do if an exception is thrown in the `try` block. An exception is thrown: the string `'Hello world!'`. `e` is now equal to that string, which we log. This results in `'Oh an error: Hello world!'`.
+`catch` āϏā§āĻā§āĻāĻŽā§āύā§āĻ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻāĻŽāϰāĻž āĻāĻāĻž āύāĻŋāϰā§āĻĻāĻŋāϏā§āĻ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ āϝ⧠_āĻāĻŋ āĻāϰāĻž āĻšāĻŦā§_ āϝāĻāύ `try` āĻŦā§āϞāĻ āĻĨā§āĻā§ āĻā§āύ āĻāĻā§āϏāϏā§āĻĒāĻļāύ āĻĨā§āϰ⧠āĻāϰāĻž āĻšā§āĨ¤ āĻāĻā§āϏāϏā§āĻĒāĻļāύ āĻĨā§āϰ⧠āĻāϰāĻž āĻšā§ā§āĻā§āĻ `'Hello world!'` āϏā§āĻā§āϰāĻŋāĻāĻāĻŋāĨ¤ `e` āĻšāϞ āĻāĻ āϏā§āĻā§āϰāĻŋāĻāĻāĻŋāϰ āϏāĻŽāĻžāύ, āϝā§āĻāĻž āϞāĻ āĻāϰāĻž āĻšā§ā§āĻā§āĨ¤ āϤāĻžāĻ āĻĢāϞāĻžāĻĢāϞ āĻšā§ā§āĻā§ `'Oh an error: Hello world!'`āĨ¤
@@ -1650,9 +1650,9 @@ console.log(myCar.make);
#### āĻāϤā§āϤāϰ: B
-When a constructor function is called with the `new` keyword, it creates an object and sets the `this` keyword to refer to that object. By default, if the constructor function doesn't explicitly return anything, it will return the newly created object.
+āϝāĻāύ āĻāĻāĻāĻŋ āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰ āĻĢāĻžāĻāĻļāύāĻā§ `new` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄ āĻĻāĻŋāϝāĻŧā§ āĻāϞ āĻāϰāĻž āĻšāϝāĻŧ, āϤāĻāύ āĻāĻāĻŋ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻ āϤā§āϰāĻŋ āĻāϰ⧠āĻāĻŦāĻ āĻāĻāĻžāĻā§ āϰā§āĻĢāĻžāϰ āĻāϰāĻžāϰ āĻāύā§āϝ `this` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄāĻāĻŋ āϏā§āĻ āĻāϰā§āĨ¤ āĻĄāĻŋāĻĢāϞā§āĻāϰā§āĻĒā§, āϝāĻĻāĻŋ āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰ āĻĢāĻžāĻāĻļāύ āϏāϰāĻžāϏāϰāĻŋ āĻāĻŋāĻā§ āϰāĻŋāĻāĻžāϰā§āύ āύāĻž āĻāϰā§, āϤāĻŦā§ āĻāĻāĻŋ āύāϤā§āύ āϤā§āϰāĻŋāĻā§āϤ āĻ
āĻŦāĻā§āĻā§āĻāĻā§āĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻŦā§āĨ¤
-In this case, the constructor function `Car` explicitly returns a new object with `make` set to `"Maserati"`, which overrides the default behavior. Therefore, when `new Car()` is called, the _returned_ object is assigned to `myCar`, resulting in the output being `"Maserati"` when `myCar.make` is accessed.
+āĻāĻ āĻā§āώā§āϤā§āϰā§, āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰ āĻĢāĻžāĻāĻļāύ `Car` āϏāϰāĻžāϏāϰāĻŋ āĻāĻāĻāĻŋ āύāϤā§āύ āĻ
āĻŦāĻā§āĻā§āĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠āϝāĻžāϰ āϏāĻžāĻĨā§ `make` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻā§ āϏā§āĻ āĻāϰāĻž āĻšā§ `"Maserati"`, āϝāĻž āĻĄāĻŋāĻĢāϞā§āĻ āĻāĻāϰāύāĻā§ āĻāĻāĻžāϰāϰāĻžāĻāĻĄ āĻāϰā§āĨ¤ āϤāĻžāĻ, āϝāĻāύ `new Car()` āĻāϞ āĻāϰāĻž āĻšāϝāĻŧ, āϤāĻāύ _returned_ āĻ
āĻŦāĻā§āĻā§āĻāĻāĻŋ `myCar`-āĻ āĻ
ā§āϝāĻžāϏāĻžāĻāύ āĻāϰāĻž āĻšāϝāĻŧ, āϝāĻžāϰ āĻĢāϞ⧠`myCar.make`āĻā§ āĻ
ā§āϝāĻžāĻā§āϏā§āϏ āĻāϰāĻž āĻšāϞ⧠āĻāĻāĻāĻĒā§āĻ `"Maserati"` āĻšāϝāĻŧāĨ¤
@@ -1680,18 +1680,18 @@ console.log(typeof y);
#### āĻāϤā§āϤāϰ: A
-`let x = (y = 10);` is actually shorthand for:
+`let x = (y = 10);` āĻāϏāϞ⧠āĻšāĻā§āĻā§ āύāĻŋāĻā§āϰ āĻāϞā§āϞā§āĻāĻŋāϤ āĻ
āĻāĻļā§āϰ āϏāĻāĻā§āώāĻŋāĻĒā§āϤāϰā§āĻĒ āĻ
```javascript
y = 10;
let x = y;
```
-When we set `y` equal to `10`, we actually add a property `y` to the global object (`window` in the browser, `global` in Node). In a browser, `window.y` is now equal to `10`.
+āĻāĻŽāϰāĻž āϝāĻāύ `y` āĻā§ āϏā§āĻ āĻāϰāĻŋ `10` āĻāϰ āϏāĻŽāĻžāύ āϤāĻāύ āĻāĻŽāϰāĻž āĻāϏāϞ⧠āĻā§āϞā§āĻŦāĻžāϞ āĻ
āĻŦāĻā§āĻā§āĻā§ āĻāĻāĻāĻŋ āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ `y` āϝā§āĻ āĻāϰāĻŋ (āĻŦā§āϰāĻžāĻāĻāĻžāϰ⧠`āĻāĻāύā§āĻĄā§`, āύā§āĻĄā§ `āĻā§āϞā§āĻŦāĻžāϞ`)āĨ¤ āĻāĻāĻāĻŋ āĻŦā§āϰāĻžāĻāĻāĻžāϰā§, `window.y` āĻāĻāύ `10` āĻāϰ āϏāĻŽāĻžāύāĨ¤
-Then, we declare a variable `x` with the value of `y`, which is `10`. Variables declared with the `let` keyword are _block scoped_, they are only defined within the block they're declared in; the immediately invoked function expression (IIFE) in this case. When we use the `typeof` operator, the operand `x` is not defined: we are trying to access `x` outside of the block it's declared in. This means that `x` is not defined. Values who haven't been assigned a value or declared are of type `"undefined"`. `console.log(typeof x)` returns `"undefined"`.
+āϤāĻžāϰāĻĒāϰ, āĻāĻŽāϰāĻž `y` āĻāϰ āĻā§āϝāĻžāϞ⧠āϏāĻš āĻāĻāĻāĻŋ āĻā§āϰāĻŋā§ā§āĻŦāϞ `x` āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰāĻŋ, āϝāĻž `10`āĨ¤ `let` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄā§āϰ āϏāĻžāĻĨā§ āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰāĻž āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞāĻā§āϞāĻŋ āĻšāϞ _block scoped_, āϤāĻžāϰāĻž āĻļā§āϧā§āĻŽāĻžāϤā§āϰ āϝ⧠āĻŦā§āϞāĻā§ āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰāĻž āĻšāϝāĻŧā§āĻā§ āϤāĻžāϰ āĻŽāϧā§āϝā§āĻ āĻĄāĻŋāĻĢāĻžāĻāύāĻā§āϤ (āϏāĻāĻā§āĻāĻžā§āĻŋāϤ) āĻĨāĻžāĻāĻŦā§; āĻāĻ āĻā§āώā§āϤā§āϰ⧠āĻāĻŽāĻŋāĻĄāĻŋā§ā§āĻāϞāĻŋ āĻāύāĻā§āĻāĻĄ āĻĢāĻžāĻāĻļāύ āĻāĻā§āϏāĻĒā§āϰā§āĻļāύ (IIFE)āĨ¤ āϝāĻāύ āĻāĻŽāϰāĻž `typeof` āĻ
āĻĒāĻžāϰā§āĻāϰ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻāĻŋ, āϏā§āĻāĻžāύ⧠āĻ
āĻĒāĻžāϰā§āύā§āĻĄ `x` āĻĄāĻŋāĻĢāĻžāĻāύ āĻšā§āύāĻŋ: āĻāĻŽāϰāĻž āϝ⧠āĻŦā§āϞāĻā§ āĻāĻāĻŋ āĻā§āώāĻŖāĻž āĻāϰāĻž āĻšāϝāĻŧā§āĻā§ āϤāĻžāϰ āĻŦāĻžāĻāϰ⧠`x`-āĻā§ āĻ
ā§āϝāĻžāĻā§āϏā§āϏ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻāĻŋāĨ¤ āĻāĻāĻžāύ⧠`x` āĻĄāĻŋāĻĢāĻžāĻāύ āĻšā§āύāĻŋāĨ¤ āϝ⧠āĻŽāĻžāύāĻā§āϞāĻŋāĻā§ āĻāĻāĻāĻŋ āĻŽāĻžāύ āĻ
ā§āϝāĻžāϏāĻžāĻāύ āĻāϰāĻž āĻšāϝāĻŧāύāĻŋ āĻŦāĻž āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰāĻž āĻšāϝāĻŧāύāĻŋ āϏā§āĻā§āϞāĻŋ `"undefined"` āĻšā§ āĻāĻžāĻāĻĒā§āϰāĨ¤ āϤāĻžāĻ `console.log(typeof x)` `"undefined"` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĻā§āĨ¤
-However, we created a global variable `y` when setting `y` equal to `10`. This value is accessible anywhere in our code. `y` is defined, and holds a value of type `"number"`. `console.log(typeof y)` returns `"number"`.
+āĻ
āύā§āϝāĻĻāĻŋāĻā§, āĻāĻŽāϰāĻž `y` āĻā§ `10` āĻāϰ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰ⧠āĻāĻāĻāĻŋ āĻā§āϞā§āĻŦāĻžāϞ āĻā§āϝā§āϰāĻŋā§ā§āĻŦāϞ āϤā§āϰāĻŋ āĻāϰā§āĻāĻŋ `y`āĨ¤ āĻāĻ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻā§āĻĄā§āϰ āϝā§āĻā§āύ āĻ
āĻāĻļ āĻĨā§āĻā§āĻ āĻ
ā§āϝāĻžāĻā§āϏā§āϏ āĻāϰāĻž āϝāĻžāĻŦā§āĨ¤ `y` āϝā§āĻšā§āϤ⧠āĻāĻāĻāĻŋ `"number"` āĻāĻžāĻāĻĒ āĻĻāĻŋā§ā§ āĻĄāĻŋāĻĢāĻžāĻāύ āĻšā§ā§āĻā§, `console.log(typeof y)` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĻā§ `"number"`āĨ¤
@@ -1730,9 +1730,9 @@ pet.bark();
#### āĻāϤā§āϤāϰ: A
-We can delete properties from objects using the `delete` keyword, also on the prototype. By deleting a property on the prototype, it is not available anymore in the prototype chain. In this case, the `bark` function is not available anymore on the prototype after `delete Dog.prototype.bark`, yet we still try to access it.
+`delete` āĻāĻŋāĻā§āĻžāϰā§āĻĄ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏ āĻŽā§āĻā§ āĻĢā§āϞāϤ⧠āĻĒāĻžāϰāĻŋ, āĻāĻāĻāĻāĻžāĻŦā§ āĻĒā§āϰā§āĻā§āĻāĻžāĻāĻĒ āĻĨā§āĻā§āĻ āĻŽā§āĻā§ āĻĢā§āϞāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻāĻāĻāĻŋ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻā§ āĻĒā§āϰā§āĻā§āĻāĻžāĻāĻĒ āĻĨā§āĻā§ āĻŽā§āĻā§ āĻĢā§āϞāϞ⧠āϤāĻžāĻā§ āĻĒā§āϰā§āĻā§āĻāĻžāĻāĻĒ āĻā§āĻāύ⧠āĻāϰ āĻĒāĻžāĻā§āĻž āϝāĻžā§ āύāĻžāĨ¤ āĻāĻā§āώā§āϤā§āϰā§, `delete Dog.prototype.bark`-āĻāϰ āĻĒāϰ⧠`bark` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻĒā§āϰā§āĻā§āĻāĻžāĻāĻĒ āĻā§āĻāύ⧠āĻāϰ āύā§āĻ, āϤāĻŦā§āĻ āĻāĻŽāϰāĻž āĻāĻāĻŋ āĻ
ā§āϝāĻžāĻā§āϏā§āϏ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰā§āĻāĻŋāĨ¤
-When we try to invoke something that is not a function, a `TypeError` is thrown. In this case `TypeError: pet.bark is not a function`, since `pet.bark` is `undefined`.
+āϝāĻāύ āĻāĻŽāϰāĻž āĻĢāĻžāĻāĻļāύ āύāϝāĻŧ āĻāĻŽāύ āĻā§āύ⧠āĻāĻŋāĻā§āĻā§ āĻāϞ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻŋ, āϤāĻāύ āĻāĻāĻāĻŋ `TypeError` āĻĨā§āϰ⧠āĻāϰāĻž āĻšāϝāĻŧāĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰ⧠`TypeError: pet.bark is not a function`, āϝā§āĻšā§āϤ⧠`pet.bark` `undefined`āĨ¤
@@ -1757,9 +1757,9 @@ console.log(set);
#### āĻāϤā§āϤāϰ: D
-The `Set` object is a collection of _unique_ values: a value can only occur once in a set.
+`Set` āĻ
āĻŦāĻā§āĻā§āĻāĻāĻŋ āĻšāϞ _āĻ
āύāύā§āϝ_ āĻā§āϝāĻžāϞā§āϏāĻŽā§āĻšā§āϰ āĻāĻāĻāĻŋ āϏāĻāĻā§āϰāĻš: āĻāĻāĻāĻŋ āϏā§āĻā§ āĻāĻāĻ āĻŽāĻžāύ āĻā§āĻŦāϞ āĻāĻāĻŦāĻžāϰāĻ āĻĨāĻžāĻāϤ⧠āĻĒāĻžāϰā§āĨ¤
-We passed the iterable `[1, 1, 2, 3, 4]` with a duplicate value `1`. Since we cannot have two of the same values in a set, one of them is removed. This results in `{1, 2, 3, 4}`.
+āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠`[1, 1, 2, 3, 4]` āĻĒāĻžāϏ āĻāϰā§āĻāĻŋ āϝā§āĻāĻžāύ⧠āĻāĻāĻāĻŋ āĻĄā§āĻĒā§āϞāĻŋāĻā§āĻ āĻŽāĻžāύ `1` āĻāĻā§āĨ¤ āϝā§āĻšā§āϤ⧠āĻāĻŽāĻžāĻĻā§āϰ āĻāĻāĻāĻŋ āϏā§āĻā§ āĻāĻāĻ āĻŽāĻžāύ āĻĻā§āĻāĻŋ āĻĨāĻžāĻāϤ⧠āĻĒāĻžāϰ⧠āύāĻž, āϤāĻžāĻĻā§āϰ āĻŽāϧā§āϝ⧠āĻāĻāĻāĻŋ āϏāϰāĻžāύ⧠āĻšāϝāĻŧāĨ¤ āϤāĻžāĻ āĻĢāϞāĻžāĻĢāϞ āĻšā§āĻā§ `{1, 2, 3, 4}`āĨ¤
@@ -1793,9 +1793,9 @@ console.log(myCounter);
#### āĻāϤā§āϤāϰ: C
-An imported module is _read-only_: you cannot modify the imported module. Only the module that exports them can change its value.
+āĻāĻāĻāĻŋ āĻāĻŽā§āĻĒā§āϰā§āĻ āĻāϰāĻž āĻŽāĻĄāĻŋāĻāϞ āĻšāϞ _āĻļā§āϧā§āĻŽāĻžāϤā§āϰ āĻĒāĻĄāĻŧāĻž āϝāĻžā§_: āĻāĻĒāύāĻŋ āĻāĻŽā§āĻĒā§āϰā§āĻ āĻāϰāĻž āĻŽāĻĄāĻŋāĻāϞ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŦā§āύ āύāĻžāĨ¤ āĻļā§āϧā§āĻŽāĻžāϤā§āϰ āϝ⧠āĻŽāĻĄāĻŋāĻāϞ āϤāĻžāĻĻā§āϰ āĻāĻā§āϏāĻĒā§āϰā§āĻ āĻāϰ⧠āϏā§āĻ āĻā§āĻŦāϞ āĻŽāĻžāύā§āϰ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāϤ⧠āĻĒāĻžāϰā§āĨ¤
-When we try to increment the value of `myCounter`, it throws an error: `myCounter` is read-only and cannot be modified.
+āϝāĻāύ āĻāĻŽāϰāĻž `myCounter` āĻāϰ āĻŽāĻžāύ āĻŦā§āĻĻā§āϧāĻŋ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻŋ, āĻāĻāĻŋ āĻāĻāĻāĻŋ āĻāϰāϰ āĻā§āĻĄāĻŧā§ āĻĻā§ā§āĻž āĻšā§: `myCounter` is read-only and cannot be modified.
@@ -1822,9 +1822,9 @@ console.log(delete age);
#### āĻāϤā§āϤāϰ: A
-The `delete` operator returns a boolean value: `true` on a successful deletion, else it'll return `false`. However, variables declared with the `var`, `const`, or `let` keywords cannot be deleted using the `delete` operator.
+`delete` āĻ
āĻĒāĻžāϰā§āĻāϰ āĻāĻāĻāĻŋ āĻŦā§āϞāĻŋāϝāĻŧāĻžāύ āĻŽāĻžāύ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§: āĻĄāĻŋāϞāĻŋāĻ āϏāĻĢāϞ āĻšāϞ⧠`true`, āĻ
āύā§āϝāĻĨāĻžāϝāĻŧ āĻāĻāĻŋ `false` āĻĒā§āϰāĻĻāĻžāύ āĻāϰāĻŦā§āĨ¤ āĻ
āύā§āϝāĻĻāĻŋāĻā§, `var`, `const`, āĻŦāĻž `let` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄā§āϰ āĻĻāĻŋā§ā§ āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰāĻž āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ `delete` āĻ
āĻĒāĻžāϰā§āĻāϰ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻŽā§āĻā§ āĻĢā§āϞāĻž āϝāĻžā§ āύāĻžāĨ¤
-The `name` variable was declared with a `const` keyword, so its deletion is not successful: `false` is returned. When we set `age` equal to `21`, we actually added a property called `age` to the global object. You can successfully delete properties from objects this way, also the global object, so `delete age` returns `true`.
+`name` āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞāĻāĻŋāĻā§ āĻāĻāĻāĻŋ `const` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄ āĻĻāĻŋāϝāĻŧā§ āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰāĻž āĻšāϝāĻŧā§āĻāĻŋāϞ, āϤāĻžāĻ āĻāĻāĻŋ āĻŽā§āĻā§ āĻĢā§āϞāĻž āϏāĻĢāϞ āĻšāϝāĻŧāύāĻŋ: `false` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻšāϝāĻŧā§āĻā§āĨ¤ āϝāĻāύ āĻāĻŽāϰāĻž `age` āϏāĻŽāĻžāύ `21` āϏā§āĻ āĻāϰāĻŋ, āĻāĻŽāϰāĻž āĻāϏāϞ⧠āĻā§āϞā§āĻŦāĻžāϞ āĻ
āĻŦāĻā§āĻā§āĻā§ `age` āύāĻžāĻŽāĻ āĻāĻāĻāĻŋ āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ āϝā§āĻ āĻāϰāĻŋāĨ¤ āĻāĻĒāύāĻŋ āϏāĻĢāϞāĻāĻžāĻŦā§ āĻ
āĻŦāĻā§āĻā§āĻāĻā§āϞ⧠āĻĨā§āĻā§ āĻāĻāĻāĻžāĻŦā§ āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋāĻā§āϞāĻŋ āĻŽā§āĻā§ āĻĢā§āϞāϤ⧠āĻĒāĻžāϰā§āύ, āĻā§āϞā§āĻŦāĻžāϞ āĻ
āĻŦāĻā§āĻā§āĻ āĻĨā§āĻā§āĻ āϤāĻžāĻ `delete age` `true` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤
@@ -1850,7 +1850,7 @@ console.log(y);
#### āĻāϤā§āϤāϰ: C
-We can unpack values from arrays or properties from objects through destructuring. For example:
+āĻāĻŽāϰāĻž āĻĄāĻŋāϏā§āĻā§āϰāĻžāĻāĻāĻžāϰā§āϰ āĻŽāĻžāϧā§āϝāĻŽā§ āĻ
ā§āϝāĻžāϰā§āϰ āĻā§āϝāĻžāϞ⧠āĻŦāĻž āĻ
āĻŦāĻā§āĻā§āĻ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏ āĻŦā§āϰ āĻāϰ⧠āĻāύāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻāĻĻāĻžāĻšāϰāĻŖ āϏā§āĻŦāϰā§āĻĒ:
```javascript
[a, b] = [1, 2];
@@ -1858,7 +1858,7 @@ We can unpack values from arrays or properties from objects through destructurin
-The value of `a` is now `1`, and the value of `b` is now `2`. What we actually did in the question, is:
+`a`-āĻāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻāύ `1` āĻāĻŦāĻ `b` -āĻāϰ āĻā§āϝāĻžāϞ⧠āĻāĻāύ `2`āĨ¤ āĻāĻŽāϰāĻž āĻāϏāϞ⧠āĻāĻ āĻĒā§āϰāĻļā§āύā§āϰ āĻŦā§āϞāĻžā§ āϝā§āĻāĻž āĻāϰā§āĻāĻŋāĻ
```javascript
[y] = [1, 2, 3, 4, 5];
@@ -1866,7 +1866,7 @@ The value of `a` is now `1`, and the value of `b` is now `2`. What we actually d
-This means that the value of `y` is equal to the first value in the array, which is the number `1`. When we log `y`, `1` is returned.
+āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ, `y` āĻāϰ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āĻšā§ āĻ
ā§āϝāĻžāϰā§āϰ ā§§āĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āĻā§āϝāĻžāϞā§, āĻāĻ āĻā§āϝāĻžāϞā§āĻāĻŋāĻŋ āĻšāϞ `1` āϏāĻāĻā§āϝāĻžāĻāĻŋāĨ¤ āϤāĻžāĻ `y` āĻā§ āϝāĻāύ āϞāĻ āĻāϰāĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻĒāĻžāĻ `1`āĨ¤
@@ -1892,7 +1892,7 @@ console.log(admin);
#### āĻāϤā§āϤāϰ: B
-It's possible to combine objects using the spread operator `...`. It lets you create copies of the key/value pairs of one object, and add them to another object. In this case, we create copies of the `user` object, and add them to the `admin` object. The `admin` object now contains the copied key/value pairs, which results in `{ admin: true, name: "Lydia", age: 21 }`.
+āϏā§āĻĒā§āϰā§āĻĄ āĻ
āĻĒāĻžāϰā§āĻāϰ `...` āĻĻāĻŋā§ā§ āĻ
āĻŦāĻā§āĻā§āĻāĻā§āϞā§āĻā§ āĻāĻāϤā§āϰāĻŋāϤ āĻāϰāĻž āϏāĻŽā§āĻāĻŦāĨ¤ āĻāϰ āĻŽāĻžāϧā§āϝāĻŽā§ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻāĻŋ/āĻā§āϝāĻžāϞ⧠āĻā§ā§āĻžāĻĻā§āĻŦā§ā§āϰ āĻāĻĒāĻŋ āϤā§āϰāĻŋ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŦā§āύ āĻāĻŦāĻ āĻ
āύā§āϝ āĻ
āĻŦāĻā§āĻā§āĻā§ āϤāĻžāĻĻā§āϰ āϝā§āĻā§āϤ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŦā§āύāĨ¤ āĻāĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž `user` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻāĻĒāĻŋ āϤā§āϰāĻŋ āĻāϰā§āĻāĻŋ āĻāĻŦāĻ `admin` āĻ
āĻŦāĻā§āĻā§āĻā§ āϝā§āĻā§āϤ āĻāϰā§āĻāĻŋāĨ¤ āϤāĻžāĻ `admin` āĻ
āĻŦāĻā§āĻā§āĻā§ āĻāĻāύ āĻāĻŋ/āĻā§āϝāĻžāϞ⧠āĻā§ā§āĻžāϰ āĻāĻĒāĻŋāĻ āϰā§ā§āĻā§, āĻĢāϞ⧠āϞāĻ āĻāϰāĻžā§ `{ admin: true, name: "Lydia", age: 21 }` āϰāĻŋāĻāĻžāϰā§āύ āĻĒāĻžāĻāĨ¤
@@ -1920,9 +1920,9 @@ console.log(Object.keys(person));
#### āĻāϤā§āϤāϰ: B
-With the `defineProperty` method, we can add new properties to an object, or modify existing ones. When we add a property to an object using the `defineProperty` method, they are by default _not enumerable_. The `Object.keys` method returns all _enumerable_ property names from an object, in this case only `"name"`.
+`defineProperty` āĻŽā§āĻĨāĻĄā§āϰ āϏāĻžāĻšāĻžāϝā§āϝā§, āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§ āύāϤā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏ āϝā§āĻ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ āĻŦāĻž āĻŦāĻŋāĻĻā§āϝāĻŽāĻžāύāĻā§āϞāĻŋāĻā§ āϏāĻāĻļā§āϧāύ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āϝāĻāύ āĻāĻŽāϰāĻž `defineProperty` āĻŽā§āĻĨāĻĄā§āϰ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻā§āύ⧠āĻ
āĻŦāĻā§āĻā§āĻā§ āĻāĻāĻāĻŋ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āϝā§āĻ āĻāϰāĻŋ, āϤāĻāύ āϏā§āĻā§āϞāĻŋ āĻĄāĻŋāĻĢāϞā§āĻāϰā§āĻĒā§ _āĻāĻŖāύāĻžāϝā§āĻā§āϝ āύāϝāĻŧ_ (_not enumerable_)āĨ¤ `Object.keys` āĻŽā§āĻĨāĻĄ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āϏāĻŽāϏā§āϤ _āĻāĻŖāύāĻžāϝā§āĻā§āϝ_ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏā§āϰ āύāĻžāĻŽ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§, āĻāĻ āĻā§āώā§āϤā§āϰ⧠āĻļā§āϧā§āĻŽāĻžāϤā§āϰ `"name"`āĨ¤
-Properties added using the `defineProperty` method are immutable by default. You can override this behavior using the `writable`, `configurable` and `enumerable` properties. This way, the `defineProperty` method gives you a lot more control over the properties you're adding to an object.
+`defineProperty` āĻŽā§āĻĨāĻĄ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āϝā§āĻ āĻāϰāĻž āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏāĻā§āϞāĻŋ āĻĄāĻŋāĻĢāϞā§āĻāϰā§āĻĒā§ āĻ
āĻĒāϰāĻŋāĻŦāϰā§āϤāύā§āϝāĻŧāĨ¤ āĻ āĻāĻāϰāĻŖāĻāĻŋāĻā§ āĻāĻĒāύāĻŋ āĻāĻāĻžāϰāϰāĻžāĻāĻĄ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύ `writable`, `configurable` āĻ `enumerable` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏāĻā§āϞāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§āĨ¤ āĻāĻāĻāĻžāĻŦā§, `defineProperty` āĻŽā§āĻĨāĻĄ āĻāĻĒāύāĻžāĻā§ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§ āϝ⧠āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏāĻā§āϞāĻŋ āϝā§āĻ āĻāϰāĻā§āύ āϤāĻžāϰ āĻāĻĒāϰ āĻ
āύā§āĻ āĻŦā§āĻļāĻŋ āύāĻŋāϝāĻŧāύā§āϤā§āϰāĻŖ āĻĻā§āϝāĻŧāĨ¤
@@ -1952,11 +1952,11 @@ console.log(data);
#### āĻāϤā§āϤāϰ: A
-The second argument of `JSON.stringify` is the _replacer_. The replacer can either be a function or an array, and lets you control what and how the values should be stringified.
+`JSON.stringify` āĻāϰ āĻĻā§āĻŦāĻŋāϤā§āϝāĻŧ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻšāϞ _replacer_āĨ¤ āϰāĻŋāĻĒā§āϞā§āϏāĻžāϰ āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻļāύ āĻŦāĻž āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āĻšāϤ⧠āĻĒāĻžāϰ⧠āĻāĻŦāĻ āĻāĻāĻŋ āĻāĻĒāύāĻžāĻā§ āύāĻŋāϝāĻŧāύā§āϤā§āϰāĻŖ āĻāϰāϤ⧠āĻĻā§āϝāĻŧ āĻā§āϝāĻžāϞā§āĻā§āϞ⧠āĻāĻŋ āĻ āĻā§āĻāĻžāĻŦā§ āϤāĻžāϰāĻž āϏā§āĻā§āϰāĻŋāĻāĻĢāĻžāĻ āĻšāĻŦā§ āϏā§āĻāĻžāĨ¤
-If the replacer is an _array_, only the property names included in the array will be added to the JSON string. In this case, only the properties with the names `"level"` and `"health"` are included, `"username"` is excluded. `data` is now equal to `"{"level":19, "health":90}"`.
+āϝāĻĻāĻŋ āϰāĻŋāĻĒā§āϞā§āϏāĻžāϰ āĻāĻāĻāĻŋ _array_ āĻšāϝāĻŧ, āĻļā§āϧā§āĻŽāĻžāϤā§āϰ āĻ
ā§āϝāĻžāϰā§āϤ⧠āĻ
āύā§āϤāϰā§āĻā§āĻā§āϤ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏā§āϰ āύāĻžāĻŽāĻā§āϞāĻŋ JSON āϏā§āĻā§āϰāĻŋāĻāϝāĻŧā§ āϝā§āĻ āĻāϰāĻž āĻšāĻŦā§āĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰā§, āĻļā§āϧā§āĻŽāĻžāϤā§āϰ `"level"` āĻāĻŦāĻ `"health"` āύāĻžāĻŽā§āϰ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏāĻā§āϞāĻŋ āĻ
āύā§āϤāϰā§āĻā§āĻā§āϤ āĻāϰāĻž āĻšāϝāĻŧā§āĻā§, `"username"` āĻŦāĻžāĻĻ āĻĻā§āĻāϝāĻŧāĻž āĻšāϝāĻŧā§āĻā§āĨ¤ āϤāĻžāĻ `data` āĻāĻāύ `"{"level":19, "health":90}"` āĻāϰ āϏāĻŽāĻžāύāĨ¤
-If the replacer is a _function_, this function gets called on every property in the object you're stringifying. The value returned from this function will be the value of the property when it's added to the JSON string. If the value is `undefined`, this property is excluded from the JSON string.
+āϝāĻĻāĻŋ āϰāĻŋāĻĒā§āϞā§āϏāĻžāϰāĻāĻŋ āĻāĻāĻāĻŋ _function_ āĻšāϝāĻŧ, āϤāĻžāĻšāϞ⧠āĻāĻĒāύāĻŋ āϝ⧠āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āϏā§āĻā§āϰāĻŋāĻāĻĢāĻžāĻ āĻāϰāĻā§āύ āϤāĻžāϰ āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏā§āϰ āĻāύā§āϝ āĻāĻ āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāϞ āĻāϰāĻž āĻšāĻŦā§āĨ¤ āĻāĻ āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻā§āϝāĻžāϞā§āĻ āĻšāĻŦā§ āϏā§āĻ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏā§āϰ āĻā§āϝāĻžāϞ⧠āϝāĻāύ āĻāĻāĻŋ JSON āϏā§āĻā§āϰāĻŋāĻ-āĻ āϝā§āĻ āĻāϰāĻž āĻšāϝāĻŧāĨ¤ āĻā§āϝāĻžāϞā§āĻāĻŋ āϝāĻĻāĻŋ `undefined` āĻšāϝāĻŧ, āϤāĻžāĻšāϞ⧠āĻāĻ āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋāĻāĻŋ JSON āϏā§āĻā§āϰāĻŋāĻ āĻĨā§āĻā§ āĻŦāĻžāĻĻ āĻĻā§āĻāϝāĻŧāĻž āĻšāĻŦā§āĨ¤
@@ -1988,9 +1988,9 @@ console.log(num2);
#### āĻāϤā§āϤāϰ: A
-The unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `num1` is `10`, since the `increaseNumber` function first returns the value of `num`, which is `10`, and only increments the value of `num` afterward.
+āĻāĻāύāĻžāϰāĻŋ āĻ
āĻĒāĻžāϰā§āĻāϰ `++` _āĻĒā§āϰāĻĨāĻŽā§ āĻ
āĻĒāĻžāϰā§āύā§āĻĄā§āϰ āĻŽāĻžāύ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§_, āϤāĻžāϰāĻĒāϰ āĻ
āĻĒāĻžāϰā§āύā§āĻĄā§āϰ āĻŽāĻžāύ āĻŦā§āĻĻā§āϧāĻŋ āĻāϰā§āĨ¤ `num1`-āĻāϰ āĻā§āϝāĻžāϞ⧠`10`, āϝā§āĻšā§āϤ⧠`increaseNumber` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻĒā§āϰāĻĨāĻŽā§ āĻā§āϝāĻžāϞā§āĻāĻŋāĻā§ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§, āϝā§āĻāĻž āĻšāϞ `10`, āϤāĻžāϰāĻĒāϰāĻ āĻā§āĻŦāϞ āĻā§āϝāĻžāϞā§āĻāĻŋāĻā§ āĻŦā§āĻĻā§āϧāĻŋ āĻāϰā§āĨ¤
-`num2` is `10`, since we passed `num1` to the `increasePassedNumber`. `number` is equal to `10`(the value of `num1`). Again, the unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `number` is `10`, so `num2` is equal to `10`.
+`num2` āĻšāϞ `10`, āϝā§āĻšā§āϤ⧠āĻāĻŽāϰāĻž `num1` āĻā§ `increasePassedNumber`-āĻ āĻĒāĻžāϏ āĻāϰā§āĻāĻŋāĨ¤ `number` āϏāĻŽāĻžāύ āĻšāϞ `10` (`num1` āĻāϰ āĻŽāĻžāύ)āĨ¤ āĻāĻŦāĻžāϰ, āĻāĻāύāĻžāϰ⧠āĻ
āĻĒāĻžāϰā§āĻāϰ `++` _āĻĒā§āϰāĻĨāĻŽā§ āĻ
āĻĒāĻžāϰā§āύā§āĻĄā§āϰ āĻŽāĻžāύ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§_, āϤāĻžāϰāĻĒāϰ āĻ
āĻĒāĻžāϰā§āύā§āĻĄā§āϰ āĻŽāĻžāύ āĻŦā§āĻĻā§āϧāĻŋ āĻāϰā§āĨ¤ āϤāĻžāĻ `number` āĻāϰ āĻā§āϝāĻžāϞ⧠āĻšāϞ `10`, āĻĢāϞ⧠`num2` āϏāĻŽāĻžāύāĻ āĻšā§ `10`āĨ¤
@@ -2022,13 +2022,13 @@ multiply(value);
#### āĻāϤā§āϤāϰ: C
-In ES6, we can initialize parameters with a default value. The value of the parameter will be the default value, if no other value has been passed to the function, or if the value of the parameter is `"undefined"`. In this case, we spread the properties of the `value` object into a new object, so `x` has the default value of `{ number: 10 }`.
+āĻāĻāϏā§Ŧ āĻ, āĻāĻŽāϰāĻž āĻĢāĻžāĻāĻļāύā§āϰ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰāĻā§ āĻāĻāĻāĻŋ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞ⧠āĻĻāĻŋā§ā§ āĻāύāĻŋāĻļāĻŋā§āĻžāϞāĻžāĻāĻ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰā§āϰ āĻā§āϝāĻžāϞā§āĻāĻŋāĻ āĻĄāĻŋāĻĢāϞā§āĻ āĻšāĻŋāϏā§āĻŦā§ āĻĨā§āĻā§ āϝāĻžā§ āϝāĻĻāĻŋ āύāĻž āĻĢāĻžāĻāĻļāύ⧠āĻ
āύā§āϝ āĻā§āύ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻž āĻšā§, āĻ
āĻĨāĻŦāĻž āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰā§āϰ āĻā§āϝāĻžāϞā§āĻāĻŋ `"undefined"` āĻšā§āĨ¤ āĻāĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž `value` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏāĻā§āϞā§āĻā§ āύāϤā§āύ āĻ
āĻŦāĻā§āĻā§āĻā§ āϏā§āĻĒā§āϰā§āĻĄ āĻāϰā§āĻāĻŋ, āϤāĻžāĻ `x`-āĻāϰ āĻāĻžāĻā§ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞ⧠āĻĨāĻžāĻāĻā§ `{ number: 10 }`āĨ¤
-The default argument is evaluated at _call time_! Every time we call the function, a _new_ object is created. We invoke the `multiply` function the first two times without passing a value: `x` has the default value of `{ number: 10 }`. We then log the multiplied value of that number, which is `20`.
+āĻĄāĻŋāĻĢāϞā§āĻ āĻāϰā§āĻā§āĻŽā§āύā§āĻāĻāĻŋāϰ āĻŽāĻžāύ āύāĻŋāϰā§āύ⧠āĻšā§āĻā§ āĻĢāĻžāĻāĻļāύ _āĻāϞā§āϰ āϏāĻŽā§_ ! āĻāĻŽāϰāĻž āĻĒā§āϰāϤāĻŋāĻŦāĻžāϰ āĻĢāĻžāĻāĻļāύ āĻāϰāĻāĻŋ, āĻāĻāĻāĻŋ _āύāϤā§āύ_ āĻ
āĻŦāĻā§āĻā§āĻ āϤā§āϰāĻŋ āĻšāĻā§āĻā§āĨ¤ āĻĒā§āϰāĻĨāĻŽ āĻĻā§āĻŦāĻžāϰ āĻāĻŽāϰāĻž āĻā§āύ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āύāĻž āĻāϰā§āĻ `multiply` āĻĢāĻžāĻāĻļāĻā§ āĻāĻžāϞāĻŋā§ā§āĻāĻŋāĻ āϤāĻžāĻ `x`-āĻāϰ āĻāĻžāĻā§ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻĨāĻžāĻāĻā§ `{ number: 10 }`āĨ¤ āϤāĻžāϰāĻĒāϰ āĻāĻŽāϰāĻž āĻā§āĻŖāĻĢāϞ āϞāĻ āĻāϰā§āĻāĻŋ, āϝā§āĻāĻŋ āĻšā§ `20`āĨ¤
-The third time we invoke multiply, we do pass an argument: the object called `value`. The `*=` operator is actually shorthand for `x.number = x.number * 2`: we modify the value of `x.number`, and log the multiplied value `20`.
+ā§Šā§ āĻŦāĻžāϰ, `multiply` āĻĢāĻžāĻāĻļāĻā§ āĻāĻžāϞāĻŋā§ā§āĻāĻŋ, āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻ `value` āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āĻĒāĻžāϏ āĻāϰā§āĨ¤ `*=` āĻ
āĻĒāĻžāϰā§āĻāϰāĻāĻŋ āĻāϏāϞ⧠`x.number = x.number * 2` āĻāϰ āϏāĻāĻā§āώāĻŋāĻĒā§āϤāϰā§āĻĒāĻ āĻāĻŽāϰāĻž `x.number`-āĻāϰ āĻā§āϝāĻžāϞā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§āĻāĻŋ āĻāĻŦāĻ āĻā§āĻŖāĻĢāϞ `20`-āĻā§ āϞāĻ āĻāϰā§āĻāĻŋāĨ¤
-The fourth time, we pass the `value` object again. `x.number` was previously modified to `20`, so `x.number *= 2` logs `40`.
+ā§Ēāϰā§āĻĨ āĻŦāĻžāϰā§, āĻāĻŽāϰāĻž āĻāĻŦāĻžāϰ `value` āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āĻĒāĻžāϏ āĻāϰā§āĻāĻŋāĨ¤ āϝā§āĻšā§āϤ⧠āĻāĻā§āϰāĻŦāĻžāϰ `x.number`-āĻāϰ āĻā§āϝāĻžāϞā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰ⧠`20` āĻĒā§ā§ā§āĻāĻŋāϞāĻžāĻŽ, āĻ
āĻŦāĻā§āĻā§āĻ āϝā§āĻšā§āϤ⧠āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāĻžāĻāĻĒ āϤāĻžāĻ āĻāĻāύ `x.number *= 2` āϞāĻ āĻāϰ⧠`40` āĻĒāĻžāĻā§āĻāĻŋāĨ¤
@@ -2051,17 +2051,17 @@ The fourth time, we pass the `value` object again. `x.number` was previously mod
#### āĻāϤā§āϤāϰ: D
-The first argument that the `reduce` method receives is the _accumulator_, `x` in this case. The second argument is the _current value_, `y`. With the reduce method, we execute a callback function on every element in the array, which could ultimately result in one single value.
+`reduce` āĻŽā§āĻĨāĻĄ ā§§āĻŽ āϝ⧠āĻāϰā§āĻā§āĻŽā§āύā§āĻāĻāĻŋ āύā§ā§ āϤāĻžāĻā§ āĻŦāϞāĻž āĻšā§ _accumulator_, āĻāĻā§āώā§āϤā§āϰ⧠āϏā§āĻāĻž `x`āĨ¤ ⧍⧠āĻāϰā§āĻā§āĻŽā§āύā§āĻāĻāĻŋāĻā§ āĻŦāϞāĻž āĻšā§ _current value_, `y`āĨ¤ `reduce` āĻŽā§āĻĨāĻĄā§āϰ āĻŽāĻžāϧā§āϝāĻŽā§, āĻāĻŽāϰāĻž āĻ
ā§āϝāĻžāϰā§āϰ āĻĒā§āϰāϤā§āĻāĻŋ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āĻāύā§āϝ āĻāĻāĻāĻŋ āĻāϞāĻŦā§āϝāĻžāĻ āĻĢāĻžāĻāĻļāύ āĻāĻžāϞāĻžāĻ, āϝāĻž āĻļā§āώ āĻĒāϰā§āϝāύā§āϤ āĻāĻāĻāĻŋ āĻāĻāĻ āĻŽāĻžāύā§āϰ āĻĢāϞāĻžāĻĢāϞ āĻĒā§āϰāĻĻāĻžāύ āĻāϰā§āĨ¤
-In this example, we are not returning any values, we are simply logging the values of the accumulator and the current value.
+āĻāĻ āĻāĻĻāĻžāĻšāϰāύā§āϰ āĻŦā§āϞāĻžā§, āĻāĻŽāϰāĻž āĻā§āύ āĻā§āϝāĻžāϞā§āĻā§āĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻāĻŋ āύāĻž, āĻā§āĻŦāϞ āĻĻā§āĻāĻŋ āĻā§āϝāĻžāϞā§āĻā§ _accumulator_ āĻ _current value_ āϞāĻ āĻāϰāĻāĻŋ
-The value of the accumulator is equal to the previously returned value of the callback function. If you don't pass the optional `initialValue` argument to the `reduce` method, the accumulator is equal to the first element on the first call.
+_accumulator_ āĻāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāϞāĻŦā§āϝāĻžāĻ āĻĢāĻžāĻāĻļāύā§āϰ āĻāĻā§āϰāĻŦāĻžāϰā§āϰ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻā§āϝāĻžāϞā§āϰ āϏāĻŽāĻžāύ āĻšā§āĨ¤ `reduce` āĻŽā§āĻĨāĻĄā§āϰ āĻāϰā§āĻā§āĻŽā§āύā§āĻā§ āĻāĻĒāύāĻŋ āϝāĻĻāĻŋ āĻ
āĻĒāĻļāύāĻžāϞ āĻā§āϝāĻžāϞ⧠`initialValue` āĻĒāĻžāϏ āύāĻž āĻāϰā§āύ, āϤāĻŦā§ ā§§āĻŽ āĻāϞā§āϰ āϏāĻŽā§ _accumulator_ āĻāϰ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āĻšā§ āĻ
ā§āϝāĻžāϰā§āϰ ā§§āĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻāĻāĻŋāĨ¤
-On the first call, the accumulator (`x`) is `1`, and the current value (`y`) is `2`. We don't return from the callback function, we log the accumulator, and the current values: `1` and `2` get logged.
+ā§§āĻŽ āĻāϞā§, _accumulator_ (`x`) āĻšā§ `1` āĻāĻŦāĻ _current value_ (`y`) āĻšā§ `2`āĨ¤ āĻāĻŽāϰāĻž āĻāϞāĻŦā§āϝāĻžāĻ āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ āĻā§āύ āĻā§āϝāĻžāϞā§āĻā§āĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻāĻŋ āύāĻž, āĻā§āĻŦāϞ _accumulator_ āĻ _current value_ āĻā§āϝāĻžāϞ⧠āϞāĻ āĻāϰāĻāĻŋāĻ `1` āĻ `2` āϞāĻ āĻšā§ā§āĻā§āĨ¤
-If you don't return a value from a function, it returns `undefined`. On the next call, the accumulator is `undefined`, and the current value is `3`. `undefined` and `3` get logged.
+āĻāĻĒāύāĻŋ āϝāĻĻāĻŋ āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ āĻāĻŋāĻā§ āϰāĻŋāĻāĻžāϰā§āύ āύāĻž āĻāϰā§āύ āϤāĻŦā§, āĻāĻāĻž `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ āϤāĻžāĻ āĻĒāϰāĻŦāϰā§āϤāĻŋ āĻāϞā§, _accumulator_ āĻšā§ `undefined` _current value_ āĻšā§ `3`āĨ¤ `undefined` āĻ `3` āϞāĻ āĻšā§ā§āĻā§āĨ¤
-On the fourth call, we again don't return from the callback function. The accumulator is again `undefined`, and the current value is `4`. `undefined` and `4` get logged.
+ā§Ēāϰā§āĻĨ āĻāϞā§, āĻāĻŽāϰāĻž āĻāĻŦāĻžāϰāĻ āĻāϞāĻŦā§āϝāĻžāĻ āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻāĻŋ āύāĻžāĨ¤ āϤāĻžāĻ _accumulator_ āĻāĻŦāĻžāϰāĻ āĻšā§ `undefined`, āĻāĻŦāĻ _current value_ āĻšā§ `4`āĨ¤ `undefined` āĻ `4` āϞāĻ āĻšā§ā§āĻā§āĨ¤
From b236c778a5ba9a79d7ea8576a0f556d4357e6361 Mon Sep 17 00:00:00 2001
From: iamsaief
Date: Sun, 2 Jun 2024 09:50:34 +0600
Subject: [PATCH 05/12] added translation till 80
---
bn-BD/README_bn-BD.md | 98 ++++++++++++++++++++++---------------------
1 file changed, 50 insertions(+), 48 deletions(-)
diff --git a/bn-BD/README_bn-BD.md b/bn-BD/README_bn-BD.md
index 1f798452..f292c293 100644
--- a/bn-BD/README_bn-BD.md
+++ b/bn-BD/README_bn-BD.md
@@ -2068,7 +2068,7 @@ _accumulator_ āĻāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāϞāĻŦā§āϝāĻžāĻ āĻĢāĻžāĻāĻļ
---
-###### 66. With which constructor can we successfully extend the `Dog` class?
+###### 66. āĻā§āύ āĻāύā§āϏāĻā§āϰāĻžāĻā§āĻāϰāĻāĻŋ āĻĻāĻŋā§ā§ āĻāĻŽāϰāĻž āϏāĻĢāϞāĻāĻžāĻŦā§ `Dog` āĻā§āϞāĻžāϏāĻā§ āĻāĻā§āϏāĻā§āύā§āĻĄ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ?
```javascript
class Dog {
@@ -2111,11 +2111,11 @@ class Labrador extends Dog {
#### āĻāϤā§āϤāϰ: B
-In a derived class, you cannot access the `this` keyword before calling `super`. If you try to do that, it will throw a ReferenceError: 1 and 4 would throw a reference error.
+āĻāĻāĻāĻŋ āĻĄāĻŋāϰāĻžāĻāĻāĻĄ āĻā§āϞāĻžāϏā§, āĻāĻĒāύāĻŋ `super` āĻāϞ āĻāϰāĻžāϰ āĻāĻā§ `this` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄ āĻ
ā§āϝāĻžāĻā§āϏā§āϏ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŦā§āύ āύāĻžāĨ¤ āĻāĻĒāύāĻŋ āϝāĻĻāĻŋ āĻāĻāĻŋ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰā§āύ āϤāĻŦā§ āĻāĻāĻŋ āĻāĻāĻāĻŋ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāϰāϰ (ReferenceError) āĻĨā§āϰ⧠āĻāϰāĻŦā§: 1 āĻāĻŦāĻ 4 āĻāĻāĻāĻŋ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāϰāϰ āĻĨā§āϰ⧠āĻāϰāĻŦā§āĨ¤
-With the `super` keyword, we call that parent class's constructor with the given arguments. The parent's constructor receives the `name` argument, so we need to pass `name` to `super`.
+`super` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄ āĻĻāĻŋāϝāĻŧā§, āĻāĻŽāϰāĻž āĻĒā§āϰāĻĻāϤā§āϤ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āϏāĻš āϏā§āĻ āĻĒā§āϝāĻžāϰā§āύā§āĻ āĻā§āϞāĻžāϏā§āϰ āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰāĻā§ āĻāϞ āĻāϰāĻŋāĨ¤ āĻĒā§āϝāĻžāϰā§āύā§āĻā§āϰ āĻāύā§āϏāĻā§āϰāĻžāĻā§āĻāϰ `name` āĻāϰā§āĻā§āĻŽā§āύā§āĻ āύā§ā§, āϤāĻžāĻ `super`-āĻ āĻāĻŽāĻžāĻĻā§āϰ `name` āĻĒāĻžāϏ āĻāϰāϤ⧠āĻšāĻŦā§āĨ¤
-The `Labrador` class receives two arguments, `name` since it extends `Dog`, and `size` as an extra property on the `Labrador` class. They both need to be passed to the constructor function on `Labrador`, which is done correctly using constructor 2.
+`Labrador` āĻā§āϞāĻžāϏ āĻĻā§āĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āύā§ā§, `name` āϝā§āĻšā§āϤ⧠āĻāĻāĻŋ `Dog` āĻā§āϞāĻžāϏāĻā§ āĻāĻā§āϏāĻā§āύā§āĻĄ āĻāϰ⧠āĻāĻŦāĻ `size` āĻā§ `Labrador` āĻā§āϞāĻžāϏ⧠āĻāĻāĻāĻŋ āĻ
āϤāĻŋāϰāĻŋāĻā§āϤ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻšāĻŋāϏāĻžāĻŦā§ āĻāĻā§āϏāĻā§āύā§āĻĄ āĻāϰā§āĨ¤ āϤāĻžāĻĻā§āϰ āĻāĻāϝāĻŧāĻā§āĻ `Labrador`-āĻāϰ āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰ āĻĢāĻžāĻāĻļāύ⧠āĻĒāĻžāϏ āĻāϰāϤ⧠āĻšāĻŦā§, āϝāĻž āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰ 2 āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āϏāĻ āĻŋāĻāĻāĻžāĻŦā§ āĻāϰāĻž āĻšāϝāĻŧā§āĻā§āĨ¤
@@ -2145,9 +2145,9 @@ export const sum = (a, b) => a + b;
#### āĻāϤā§āϤāϰ: B
-With the `import` keyword, all imported modules are _pre-parsed_. This means that the imported modules get run _first_, and the code in the file that imports the module gets executed _after_.
+`import` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϞā§, `import` āĻāϰāĻž āϏāĻŽāϏā§āϤ āĻŽāĻĄāĻŋāĻāϞ _āĻĒā§āϰāĻŋ-āĻĒāĻžāϰā§āϏ_ āĻāϰāĻž āĻšāϝāĻŧāĨ¤ āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ āϝ⧠āĻāĻŽā§āĻĒā§āϰā§āĻ āĻāϰāĻž āĻŽāĻĄāĻŋāĻāϞāĻā§āϞāĻŋ _āĻĒā§āϰāĻĨāĻŽā§_ āĻāĻžāϞāĻžāύ⧠āĻšāϝāĻŧ, āĻāĻŦāĻ āϝ⧠āĻĢāĻžāĻāϞ⧠āĻŽāĻĄāĻŋāĻāϞāĻāĻŋ āĻāĻŽā§āĻĒā§āϰā§āĻ āĻāϰāĻž āĻšā§ āϤāĻžāϰ āĻā§āĻĄ _āĻĒāϰāĻŦāϰā§āϤā§āϤā§_ āĻāϞāĻŦā§āĨ¤
-This is a difference between `require()` in CommonJS and `import`! With `require()`, you can load dependencies on demand while the code is being run. If we had used `require` instead of `import`, `running index.js`, `running sum.js`, `3` would have been logged to the console.
+āĻāĻāĻŋ CommonJS-āĻ `require()` āĻāĻŦāĻ `import` āĻāϰ āĻŽāϧā§āϝ⧠āĻāĻāĻāĻŋ āĻĒāĻžāϰā§āĻĨāĻā§āϝ! `require()` āĻĻāĻŋāϝāĻŧā§, āĻā§āĻĄ āĻāĻžāϞāĻžāύā§āϰ āϏāĻŽāϝāĻŧ āĻāĻĒāύāĻŋ āĻĒā§āϰā§ā§āĻāύ āĻ
āύā§āϝāĻžā§ā§ āĻĄāĻŋāĻĒā§āύā§āĻĄā§āύā§āϏāĻŋāĻā§āϞ⧠āϞā§āĻĄ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤ āĻāĻŽāϰāĻž āϝāĻĻāĻŋ `import` āĻāϰ āĻĒāϰāĻŋāĻŦāϰā§āϤ⧠`require` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤāĻžāĻŽ, āĻāύāϏā§āϞ⧠āϞāĻ āĻšāϤā§āĻ `running index.js`, `running sum.js`, `3`āĨ¤
@@ -2172,7 +2172,7 @@ console.log(Symbol('foo') === Symbol('foo'));
#### āĻāϤā§āϤāϰ: A
-Every Symbol is entirely unique. The purpose of the argument passed to the Symbol is to give the Symbol a description. The value of the Symbol is not dependent on the passed argument. As we test equality, we are creating two entirely new symbols: the first `Symbol('foo')`, and the second `Symbol('foo')`. These two values are unique and not equal to each other, `Symbol('foo') === Symbol('foo')` returns `false`.
+āĻĒā§āϰāϤāĻŋāĻāĻŋ Symbol āϏāĻŽā§āĻĒā§āϰā§āĻŖ āĻ
āύāύā§āϝāĨ¤ Symbol-āĻ āĻĒāĻžāϏ āĻāϰāĻž āĻāϰā§āĻā§āĻŽā§āύā§āĻāĻāĻŋāϰ āĻāĻĻā§āĻĻā§āĻļā§āϝ āĻšāϞ Symbol-āĻāĻŋāĻā§ āĻāĻāĻāĻŋ āĻŦāϰā§āĻŖāύāĻž āĻĻā§āĻāϝāĻŧāĻžāĨ¤ Symbol-āĻāϰ āĻŽāĻžāύ āĻĒāĻžāϏ āĻāϰāĻž āĻāϰā§āĻā§āĻŽā§āύā§āĻā§āϰ āĻāĻĒāϰ āύāĻŋāϰā§āĻāϰ āĻāϰ⧠āύāĻžāĨ¤ āĻāĻŽāϰāĻž āϏāĻŽāϤāĻž āĻĒāϰā§āĻā§āώāĻž āĻāϰāĻžāϰ āϏāĻŽāϝāĻŧ, āĻāĻŽāϰāĻž āĻĻā§āĻāĻŋ āϏāĻŽā§āĻĒā§āϰā§āĻŖ āύāϤā§āύ Symbol āϤā§āϰāĻŋ āĻāϰāĻāĻŋ: āĻĒā§āϰāĻĨāĻŽ `Symbol('foo')`, āĻāĻŦāĻ āĻĻā§āĻŦāĻŋāϤā§āϝāĻŧ `Symbol('foo')`āĨ¤ āĻāĻ āĻĻā§āĻāĻŋ āĻŽāĻžāύ āĻ
āύāύā§āϝ āĻāĻŦāĻ āĻāĻā§ āĻ
āĻĒāϰā§āϰ āϏāĻŽāĻžāύ āύāϝāĻŧ, āϤāĻžāĻ `Symbol('foo') === Symbol('foo')` `false` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤
@@ -2197,9 +2197,9 @@ console.log(name.padStart(2));
#### āĻāϤā§āϤāϰ: C
-With the `padStart` method, we can add padding to the beginning of a string. The value passed to this method is the _total_ length of the string together with the padding. The string `"Lydia Hallie"` has a length of `12`. `name.padStart(13)` inserts 1 space at the start of the string, because 12 + 1 is 13.
+`padStart` āĻĒāĻĻā§āϧāϤāĻŋāϰ āϏāĻžāĻšāĻžāϝā§āϝā§, āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻāϝāĻŧā§āϰ āĻļā§āϰā§āϤ⧠āĻĒā§āϝāĻžāĻĄāĻŋāĻ (āĻļā§āύā§āϝāϏā§āĻĨāĻžāύ) āϝā§āĻ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻāĻ āĻĒāĻĻā§āϧāϤāĻŋāϤ⧠āĻĒāĻžāϏ āĻāϰāĻž āĻŽāĻžāύ āĻšāϞ āĻĒā§āϝāĻžāĻĄāĻŋāĻāϝāĻŧā§āϰ āϏāĻžāĻĨā§ āϏā§āĻā§āϰāĻŋāĻāϝāĻŧā§āϰ _āĻŽā§āĻ_ āĻĻā§āϰā§āĻā§āϝāĨ¤ āϏā§āĻā§āϰāĻŋāĻ `"Lydia Hallie"` āĻāϰ āĻĻā§āϰā§āĻā§āϝ `12`āĨ¤ `name.padStart(13)` āϏā§āĻā§āϰāĻŋāĻ āĻāϰ āĻļā§āϰā§āϤ⧠1āĻāĻŋ āĻļā§āύā§āϝāϏā§āĻĨāĻžāύ āϝā§āĻā§āϤ āĻāϰāĻžāϰ āĻāĻžāϰāύ⧠_āĻŽā§āĻ_ āĻĻā§āϰā§āĻā§āϝ 12 + 1 āĻ
āϰā§āĻĨāĻžā§ 13 āĻšā§āĨ¤
-If the argument passed to the `padStart` method is smaller than the length of the array, no padding will be added.
+āϝāĻĻāĻŋ `padStart` āĻĒāĻĻā§āϧāϤāĻŋāϤ⧠āĻĒāĻžāϏ āĻāϰāĻž āĻāϰā§āĻā§āĻŽā§āύā§āĻ āϏā§āĻā§āϰāĻŋāĻ-āĻāϰ āĻĻā§āϰā§āĻā§āϝā§āϰ āĻā§āϝāĻŧā§ āĻā§āĻ āĻšāϝāĻŧ, āϤāĻžāĻšāϞ⧠āĻā§āύ⧠āĻĒā§āϝāĻžāĻĄāĻŋāĻ āϝā§āĻ āĻāϰāĻž āĻšāĻŦā§ āύāĻžāĨ¤
@@ -2222,19 +2222,19 @@ console.log('đĨ' + 'đģ');
#### āĻāϤā§āϤāϰ: A
-With the `+` operator, you can concatenate strings. In this case, we are concatenating the string `"đĨ"` with the string `"đģ"`, resulting in `"đĨđģ"`.
+`+` āĻ
āĻĒāĻžāϰā§āĻāϰ āĻĻāĻŋā§ā§, āĻāĻĒāύāĻŋ āϏā§āĻā§āϰāĻŋāĻ āϝā§āĻā§āϤ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤ āĻāĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž āϏā§āĻā§āϰāĻŋāĻ `"đĨ"` āĻā§ āϏā§āĻā§āϰāĻŋāĻ `"đģ"` -āĻāϰ āϏāĻžāĻĨā§ āϝā§āĻā§āϤ āĻāϰāĻāĻŋ, āϝāĻžāϰ āĻĢāϞāĻžāĻĢāϞ `"đĨđģ"`āĨ¤
---
-###### 71. How can we log the values that are commented out after the console.log statement?
+###### 71. `console.log` āϏā§āĻā§āϝāĻžāĻāĻŽā§āϝāĻžāύā§āĻ āĻāϰ āĻĒāϰ⧠āĻāĻŽā§āύā§āĻ āĻāϰāĻž āĻā§āϝāĻžāϞā§āĻāĻŋāĻā§ āĻāĻŽāϰāĻž āĻāĻŋāĻāĻžāĻŦā§ āϞāĻ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ?
```javascript
function* startGame() {
- const āĻāϤā§āϤāϰ = yield 'Do you love JavaScript?';
- if (āĻāϤā§āϤāϰ !== 'Yes') {
+ const answer = yield 'Do you love JavaScript?';
+ if (answer !== 'Yes') {
return "Oh wow... Guess we're done here";
}
return 'JavaScript loves you back â¤ī¸';
@@ -2255,11 +2255,11 @@ console.log(/* 2 */); // JavaScript loves you back â¤ī¸
#### āĻāϤā§āϤāϰ: C
-A generator function "pauses" its execution when it sees the `yield` keyword. First, we have to let the function yield the string "Do you love JavaScript?", which can be done by calling `game.next().value`.
+āĻāĻāĻāĻŋ āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ āϝāĻāύ `yield` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄāĻāĻŋ āĻĻā§āĻā§ āϤāĻāύ āϤāĻžāϰ āĻāϞāĻŽāĻžāύ āĻ
āĻŦāϏā§āĻĨāĻžā§ "āĻŦāĻŋāϰāϤāĻŋ āĻĻā§āϝāĻŧ" ("pauses" execution)āĨ¤ āĻĒā§āϰāĻĨāĻŽāϤ, āĻāĻŽāĻžāĻĻā§āϰ āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻĨā§āĻā§ "Do you love JavaScript?" āϏā§āĻā§āϰāĻŋāĻāĻāĻŋ āĻĒā§āϤ⧠āĻšāĻŦā§, āϝāĻž `game.next().value` āĻāϞ āĻāϰ⧠āĻĒāĻžāĻā§āĻž āϝāĻžāĻŦā§āĨ¤
-Every line is executed, until it finds the first `yield` keyword. There is a `yield` keyword on the first line within the function: the execution stops with the first yield! _This means that the variable `āĻāϤā§āϤāϰ` is not defined yet!_
+āĻĒā§āϰāϤāĻŋāĻāĻŋ āϞāĻžāĻāύ āĻāĻžāϞāύāĻž āĻāϰāĻž āĻšāϝāĻŧ, āϝāϤāĻā§āώāĻŖ āύāĻž āĻāĻāĻŋ āĻĒā§āϰāĻĨāĻŽ `yield` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄ āĻā§āĻāĻā§ āĻĒāĻžāϝāĻŧāĨ¤ āĻĢāĻžāĻāĻļāύā§āϰ āĻŽāϧā§āϝ⧠āĻĒā§āϰāĻĨāĻŽ āϞāĻžāĻāύ⧠āĻāĻāĻāĻŋ `yield` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄ āĻāĻā§: āĻĒā§āϰāĻĨāĻŽ āĻĢāϞāĻžāĻĢāϞā§āϰ (yield) āϏāĻžāĻĨā§āĻ āĻāĻā§āϏāĻŋāĻāĻŋāĻāĻļāύ āĻŦāύā§āϧ āĻšāϝāĻŧā§ āϝāĻžāϝāĻŧ! _āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ `answer` āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ āĻāĻāύ⧠āĻĄāĻŋāĻĢāĻžāĻāύ āĻāϰāĻž āĻšāϝāĻŧāύāĻŋ!_
-When we call `game.next("Yes").value`, the previous `yield` is replaced with the value of the parameters passed to the `next()` function, `"Yes"` in this case. The value of the variable `āĻāϤā§āϤāϰ` is now equal to `"Yes"`. The condition of the if-statement returns `false`, and `JavaScript loves you back â¤ī¸` gets logged.
+āϝāĻāύ āĻāĻŽāϰāĻž `game.next("Yes").value` āĻāϞ āĻāϰāĻŋ, āϤāĻāύ āĻāĻā§āϰ `yield`āĻāĻŋāĻā§ `next()` āĻĢāĻžāĻāĻļāύ⧠āĻĒāĻžāϏ āĻāϰāĻž āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰā§āϰ āĻŽāĻžāύ āĻĻāĻŋāϝāĻŧā§ āĻĒā§āϰāϤāĻŋāϏā§āĻĨāĻžāĻĒāĻŋāϤ āĻāϰāĻž āĻšāϝāĻŧ, āĻāĻ āĻā§āώā§āϤā§āϰ⧠`"Yes"` āĻĻāĻŋā§ā§āĨ¤ āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ `answer` āĻāϰ āĻŽāĻžāύ āĻāĻāύ `"Yes"` āĻāϰ āϏāĻŽāĻžāύāĨ¤ āĻāĻĢ-āϏā§āĻā§āϝāĻžāĻāĻŽā§āϝāĻžāύā§āĻā§āϰ āĻļāϰā§āϤ `false` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠āĻāĻŦāĻ `JavaScript loves you back â¤ī¸` āϞāĻ āĻšāϝāĻŧā§ āϝāĻžāϝāĻŧāĨ¤
@@ -2282,19 +2282,19 @@ console.log(String.raw`Hello\nworld`);
#### āĻāϤā§āϤāϰ: C
-`String.raw` returns a string where the escapes (`\n`, `\v`, `\t` etc.) are ignored! Backslashes can be an issue since you could end up with something like:
+`String.raw` āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠āϝā§āĻāĻžāύ⧠āĻāϏā§āĻā§āĻĒ āĻā§āϝāĻžāϰā§āĻā§āĻāĻžāϰ (`\n`, `\v`, `\t` āĻāϤā§āϝāĻžāĻĻāĻŋ) āĻāĻĒā§āĻā§āώāĻž āĻāϰāĻž āĻšāϝāĻŧ! āĻŦā§āϝāĻžāĻāϏā§āϞā§āϝāĻžāĻļāĻā§āϞāĻŋ āĻāĻāĻāĻŋ āϏāĻŽāϏā§āϝāĻž āĻšāϤ⧠āĻĒāĻžāϰ⧠āϝāĻāύ āĻāĻĒāύāĻŋ āĻāĻŽāύ āĻāĻŋāĻā§ āĻĒāĻžāĻŦā§āύ:
`` const path = `C:\Documents\Projects\table.html` ``
-Which would result in:
+āϝāĻžāϰ āĻĢāϞ⧠āĻāĻāĻāĻĒā§āĻ āĻšāĻŦā§:
`"C:DocumentsProjects able.html"`
-With `String.raw`, it would simply ignore the escape and print:
+`String.raw` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϞā§, āĻāĻāĻŋ āĻā§āĻŦāϞ āĻāϏā§āĻā§āĻĒ āĻā§āϝāĻžāϰā§āĻā§āĻāĻžāϰ āĻāĻĒā§āĻā§āώāĻž āĻāϰāĻŦā§ āĻāĻŦāĻ āĻĒā§āϰāĻŋāύā§āĻ āĻāϰāĻŦā§:
`C:\Documents\Projects\table.html`
-In this case, the string is `Hello\nworld`, which gets logged.
+āĻāĻ āĻā§āώā§āϤā§āϰā§, āϞāĻ āĻšāĻā§āĻž āϏā§āĻā§āϰāĻŋāĻāĻāĻŋ āĻšāϞ `Hello\nworld`āĨ¤
@@ -2322,13 +2322,13 @@ console.log(data);
#### āĻāϤā§āϤāϰ: C
-An async function always returns a promise. The `await` still has to wait for the promise to resolve: a pending promise gets returned when we call `getData()` in order to set `data` equal to it.
+āĻāĻāĻāĻŋ **async** āĻĢāĻžāĻāĻļāύ āϏāϰā§āĻŦāĻĻāĻž āĻāĻāĻāĻŋ āĻĒā§āϰāϤāĻŋāĻļā§āϰā§āϤāĻŋ (promise) āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ āĻĒā§āϰāĻŽāĻŋāϏ āϏāĻŽāĻžāϧāĻžāύā§āϰ (resolve) āĻāύā§āϝ `await`āĻā§ āĻāĻāύāĻ āĻ
āĻĒā§āĻā§āώāĻž āĻāϰāϤ⧠āĻšāĻā§āĻā§: āϝāĻāύ `getData()` āĻāϞ āĻāϰ⧠āĻāĻāĻŋāϰ āĻŽāĻžāύāĻā§ `data`-āϰ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻž āĻšā§ āϤāĻāύ āĻāϏāϞ⧠āĻāĻāĻāĻŋ āĻ
āĻŽā§āĻŽāĻžāĻāϏāĻŋāϤ (pending) āĻĒā§āϰāĻŽāĻŋāϏ āϰāĻŋāĻāĻžāϰā§āύ āĻā§āϝāĻžāϞ⧠āĻšāĻŋāϏā§āĻŦā§ āĻĒāĻžāĻā§āĻž āϝāĻžā§āĨ¤
-If we wanted to get access to the resolved value `"I made it"`, we could have used the `.then()` method on `data`:
+āϝāĻĻāĻŋ āĻāĻŽāϰāĻž āĻĒā§āϰāĻŽāĻŋāϏ āϏāĻŽāĻžāϧāĻžāύā§āϰ āĻā§āϝāĻžāϞā§āϰ - `"I made it"` āĻ
ā§āϝāĻžāĻā§āϏā§āϏ āĻĒā§āϤ⧠āĻāĻžāĻāϤāĻžāĻŽ, āϤāĻžāĻšāϞ⧠`data`-āϤ⧠`.then()` āĻŽā§āĻĨāĻĄ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻšāϤ:
`data.then(res => console.log(res))`
-This would've logged `"I made it!"`
+āϤāĻŦā§āĻ āĻāĻāĻŋ āϞāĻ āĻāϰāϤ `"I made it!"`⧎
@@ -2356,9 +2356,9 @@ console.log(result);
#### āĻāϤā§āϤāϰ: B
-The `.push()` method returns the _length_ of the new array! Previously, the array contained one element (the string `"banana"`) and had a length of `1`. After adding the string `"apple"` to the array, the array contains two elements, and has a length of `2`. This gets returned from the `addToList` function.
+`.push()` āĻŽā§āĻĨāĻĄ āύāϤā§āύ āĻ
ā§āϝāĻžāϰā§āϰ _length_ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§! āĻĒā§āϰā§āĻŦā§, āĻ
ā§āϝāĻžāϰā§āϤ⧠āĻāĻāĻāĻŋ āĻāϞāĻŋāĻŽā§āύā§āĻ āĻāĻŋāϞ (āϏā§āĻā§āϰāĻŋāĻ `"banana"`) āĻāĻŦāĻ āĻāϰ āĻĻā§āϰā§āĻā§āϝ āĻāĻŋāϞ `1`āĨ¤ āĻ
ā§āϝāĻžāϰā§āϤ⧠āϏā§āĻā§āϰāĻŋāĻ `"apple"` āϝā§āĻ āĻāϰāĻžāϰ āĻĒāϰ, āĻ
ā§āϝāĻžāϰā§āϰ āĻŽā§āĻ āĻāϞāĻŋāĻŽā§āύā§āĻ āĻšā§ āĻĻā§āĻāĻŋ āĻāĻŦāĻ āĻāϰ āĻĻā§āϰā§āĻā§āϝ āĻšā§ `2`āĨ¤ āĻāĻāĻŋāĻ 'addToList' āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ āϰāĻŋāĻāĻžāϰā§āύ āĻāϏāĻā§āĨ¤
-The `push` method modifies the original array. If you wanted to return the _array_ from the function rather than the _length of the array_, you should have returned `list` after pushing `item` to it.
+`push` āĻŽā§āĻĨāĻĄāĻāĻŋ āĻŽā§āϞ āĻ
ā§āϝāĻžāϰā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§āĨ¤ āĻāĻĒāύāĻŋ āϝāĻĻāĻŋ _āĻ
ā§āϝāĻžāϰā§āϰ āĻĻā§āϰā§āĻā§āϝā§_-āϰ āĻĒāϰāĻŋāĻŦāϰā§āϤ⧠āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ _array_-āĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāĻžāĻāϤā§āύ, āϤāĻžāĻšāϞ⧠`item`-āĻā§ āĻĒā§āĻļ āĻāϰāĻžāϰ āĻĒāϰ⧠āĻāĻĒāύāĻžāϰ āĻāĻāĻŋāϤ āĻāĻŋāϞ `list`-āĻā§ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻžāĨ¤
@@ -2388,11 +2388,11 @@ console.log(shape);
#### āĻāϤā§āϤāϰ: B
-`Object.freeze` makes it impossible to add, remove, or modify properties of an object (unless the property's value is another object).
+`Object.freeze` āĻ
āĻŦāĻā§āĻā§āĻā§ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āϝā§āĻ, āĻŦāĻžāĻĻ āĻŦāĻž āϏāĻāĻļā§āϧāύ āĻāϰāĻž āĻ
āϏāĻŽā§āĻāĻŦ āĻāϰ⧠āϤā§āϞ⧠(āϝāĻĻāĻŋ āύāĻž āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻŽāĻžāύ āĻ
āύā§āϝ āĻā§āύ⧠āĻ
āĻŦāĻā§āĻā§āĻ āĻšāϝāĻŧ)āĨ¤
-When we create the variable `shape` and set it equal to the frozen object `box`, `shape` also refers to a frozen object. You can check whether an object is frozen by using `Object.isFrozen`. In this case, `Object.isFrozen(shape)` would return true, since the variable `shape` has a reference to a frozen object.
+āϝāĻāύ āĻāĻŽāϰāĻž āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ `shape` āϤā§āϰāĻŋ āĻāϰāĻŋ āĻāĻŦāĻ āϤāĻžāĻā§ āĻĢā§āϰā§āĻā§āύ āĻ
āĻŦāĻā§āĻā§āĻ `box` āĻāϰ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻŋ, `shape`-āĻ āϏā§āĻ āĻĢā§āϰā§āĻā§āύ āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āϰā§āĻĢāĻžāϰ āĻāϰā§āĨ¤ āĻāĻĒāύāĻŋ `Object.isFrozen` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻā§āύ⧠āĻ
āĻŦāĻā§āĻā§āĻ āĻĢā§āϰā§āĻā§āύ āĻšāϝāĻŧā§āĻā§ āĻāĻŋāύāĻž āϤāĻž āĻĒāϰā§āĻā§āώāĻž āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰā§, `Object.isFrozen(shape)` true āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻŦā§, āĻāĻžāϰāύ āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ `shape`-āĻāϰ āĻāĻžāĻā§ āĻāĻāĻāĻŋ āĻĢā§āϰā§āĻā§āύ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāĻā§āĨ¤
-Since `shape` is frozen, and since the value of `x` is not an object, we cannot modify the property `x`. `x` is still equal to `10`, and `{ x: 10, y: 20 }` gets logged.
+āϝā§āĻšā§āϤ⧠`shape` āĻĢā§āϰā§āĻā§āύ āĻšā§ā§āĻā§, āĻāĻŦāĻ `x` āĻāϰ āĻŽāĻžāύ āĻā§āύ⧠āĻ
āĻŦāĻā§āĻā§āĻ āύāϝāĻŧ, āϤāĻžāĻ āĻāĻŽāϰāĻž `x` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ āύāĻžāĨ¤ `x` āĻāĻāύāĻ `10` āĻāϰ āϏāĻŽāĻžāύ, āĻāĻŦāĻ `{ x: 10, y: 20 }` āϞāĻ āĻāϰāĻž āĻšāϝāĻŧā§āĻā§āĨ¤
@@ -2417,7 +2417,7 @@ console.log(firstName);
#### āĻāϤā§āϤāϰ: D
-By using [destructuring assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) syntax we can unpack values from arrays, or properties from objects, into distinct variables:
+[āĻĄāĻŋāϏā§āĻā§āϰāĻžāĻāĻāĻžāϰāĻŋāĻ āĻ
ā§āϝāĻžāϏāĻžāĻāύāĻŽā§āύā§āĻ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) āϏāĻŋāύāĻā§āϝāĻžāĻā§āϏ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§, āĻāĻŽāϰāĻž āĻ
ā§āϝāĻžāϰā§āϰ āĻā§āϝāĻžāϞā§, āĻŦāĻž āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻŦā§āϰ āĻāϰ⧠āĻāϞāĻžāĻĻāĻž āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞ⧠āϰāĻžāĻāϤ⧠āĻĒāĻžāϰāĻŋāĻ
```javascript
const { firstName } = { firstName: 'Lydia' };
@@ -2427,7 +2427,7 @@ const { firstName } = { firstName: 'Lydia' };
console.log(firstName); // "Lydia"
```
-Also, a property can be unpacked from an object and assigned to a variable with a different name than the object property:
+āĻāĻŦāĻžāϰ, āĻ
āĻŦāĻā§āĻā§āĻ āĻĨā§āĻā§ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻŦā§āϰ āĻāϰ⧠āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āύāĻžāĻŽā§ āύāĻž āϰā§āĻā§ āĻ
āύā§āϝ āύāĻžāĻŽā§āϰ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞā§āĻ āϰāĻžāĻāϤ⧠āĻĒāĻžāϰāĻŋāĻ
```javascript
const { firstName: myName } = { firstName: 'Lydia' };
@@ -2438,9 +2438,9 @@ console.log(myName); // "Lydia"
console.log(firstName); // Uncaught ReferenceError: firstName is not defined
```
-Therefore, `firstName` does not exist as a variable, thus attempting to access its value will raise a `ReferenceError`.
+āĻ
āϤāĻāĻŦ, `firstName` āĻāĻāĻāĻŋ āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ āĻšāĻŋāϏā§āĻŦā§ āĻāϰ āύā§āĻ, āĻāĻāĻāĻžāĻŦā§ āĻāϰ āĻŽāĻžāύ āĻ
ā§āϝāĻžāĻā§āϏā§āϏ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāϞ⧠`ReferenceError` āϤā§āϰāĻŋ āĻšāĻŦā§āĨ¤
-**Note:** Be aware of the `global scope` properties:
+**āĻĻā§āϰāώā§āĻāĻŦā§āϝ:** `āĻā§āϞā§āĻŦāĻžāϞ āϏā§āĻā§āĻĒ` āĻŦā§āĻļāĻŋāώā§āĻā§āϝ āϏāĻŽā§āĻĒāϰā§āĻā§ āϏāĻā§āϤāύ āĻĨāĻžāĻā§āύ:
```javascript
const { name: myName } = { name: 'Lydia' };
@@ -2450,18 +2450,18 @@ console.log(name); // "" ----- Browser e.g. Chrome
console.log(name); // ReferenceError: name is not defined ----- NodeJS
```
-Whenever Javascript is unable to find a variable within the _current scope_, it climbs up the [Scope chain](https://github.com/getify/You-Dont-Know-JS/blob/2nd-ed/scope-closures/ch3.md) and searches for it and if it reaches the top-level scope, aka **Global scope**, and still doesn't find it, it will throw a `ReferenceError`.
+āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āϝāĻāύāĻ āĻāĻāĻāĻŋ āĻā§āϰāĻŋā§ā§āĻŦāϞāĻā§ āϤāĻžāϰ _āĻŦāϰā§āϤāĻŽāĻžāύ āϏā§āĻā§āĻĒā§_ āĻā§āĻāĻā§ āĻĒāĻžā§ āύāĻž, āϤāĻāύ āĻāĻāĻŋāĻā§ āĻā§āĻāĻā§ āĻĒāĻžāĻā§āĻžāϰ āĻāύā§āϝ [āϏā§āĻā§āĻĒ āĻā§āĻāύ](https://github.com/getify/You-Dont-Know-JS/blob/2nd-ed/scope-closures/ch3.md)-āĻāϰ āĻāĻĒāϰ⧠āĻāĻ ā§ āĻāĻŦāĻ āϝāĻĻāĻŋ āĻāĻāĻŋ āĻļā§āϰā§āώ-āϏā§āϤāϰā§āϰ āϏā§āĻā§āĻĒā§ āĻĒā§āĻāĻāĻžāϝāĻŧ, āĻāϰāĻĢā§ **āĻā§āϞā§āĻŦāĻžāϞ āϏā§āĻā§āĻĒ**, āĻāĻŦāĻ āĻāĻāĻžāύā§āĻ āĻā§āĻāĻā§ āύāĻž āĻĒāĻžāϝāĻŧ, āϤāĻžāĻšāϞ⧠āĻāĻāĻŋ āĻāĻāĻāĻŋ `ReferenceError` āĻĨā§āϰ⧠āĻāϰāĻŦā§āĨ¤
-- In **Browsers** such as _Chrome_, `name` is a _deprecated global scope property_. In this example, the code is running inside _global scope_ and there is no user-defined local variable for `name`, therefore it searches the predefined _variables/properties_ in the global scope which is in the case of browsers, it searches through `window` object and it will extract the [window.name](https://developer.mozilla.org/en-US/docs/Web/API/Window/name) value which is equal to an **empty string**.
+- **āĻŦā§āϰāĻžāĻāĻāĻžāϰā§** āϝā§āĻŽāύ _Chrome_, `name` āĻšāϞ āĻāĻāĻāĻŋ _āĻĄā§āĻĒā§āϰāĻŋāĻā§āĻā§āĻĄ āĻā§āϞā§āĻŦāĻžāϞ āϏā§āĻā§āĻĒ āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ_āĨ¤ āĻāĻ āĻāĻĻāĻžāĻšāϰāύā§, āĻā§āĻĄāĻāĻŋ _global scope_ āĻāϰ āĻāĻŋāϤāϰ⧠āĻāϞāĻā§ āĻāĻŦāĻ `name` āĻāϰ āĻāύā§āϝ āĻā§āύ⧠āĻāĻāĻāĻžāϰ-āĻĄāĻŋāĻĢāĻžāĻāύā§āĻĄ āϞā§āĻāĻžāϞ āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ āύā§āĻ, āϤāĻžāĻ āĻāĻāĻŋ āĻĒā§āϰā§āĻŦāύāĻŋāϰā§āϧāĻžāϰāĻŋāϤ _āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ/āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ_ āĻā§āϞā§āĻŦāĻžāϞ āϏā§āĻā§āĻĒā§ āĻā§āĻāĻā§ āĻĻā§āĻā§ āϝāĻž āĻŦā§āϰāĻžāĻāĻāĻžāϰā§āϰ āĻā§āώā§āϤā§āϰā§, `window` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻā§āϤāϰ⧠āĻā§āĻāĻāĻŦā§ āĻāĻŦāĻ āĻāĻāĻŋ [window.name](https://developer.mozilla.org/en-US/docs/Web/API/Window/name) āĻŽāĻžāύāĻāĻŋ āĻŦā§āϰ āĻāϰāĻŦā§ āĻāĻāĻāĻŋ **āĻāĻžāϞāĻŋ āϏā§āĻā§āϰāĻŋāĻ** āĻāϰ āϏāĻŽāĻžāύāĨ¤
-- In **NodeJS**, there is no such property on the `global` object, thus attempting to access a non-existent variable will raise a [ReferenceError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Not_defined).
+- **āύā§āĻĄāĻā§āĻāϏ**-āĻ, `āĻā§āϞā§āĻŦāĻžāϞ` āĻ
āĻŦāĻā§āĻā§āĻā§ āĻāĻŽāύ āĻā§āύ⧠āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ āύā§āĻ, āĻāĻāĻāĻžāĻŦā§ āĻ
āϏā§āϤāĻŋāϤā§āĻŦāĻšā§āύ āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ āĻ
ā§āϝāĻžāĻā§āϏā§āϏ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāϞ⧠āĻāĻāĻāĻŋ [ReferenceError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Not_defined) āϤā§āϰāĻŋ āĻšā§āĨ¤
---
-###### 77. Is this a pure function?
+###### 77. āĻāĻāĻŋ āĻāĻŋ āĻāĻāĻāĻŋ āĻŦāĻŋāĻļā§āĻĻā§āϧ āĻĢāĻžāĻāĻļāύ?
```javascript
function sum(a, b) {
@@ -2477,9 +2477,9 @@ function sum(a, b) {
#### āĻāϤā§āϤāϰ: A
-A pure function is a function that _always_ returns the same result, if the same arguments are passed.
+āĻāĻāĻāĻŋ āĻŦāĻŋāĻļā§āĻĻā§āϧ āĻĢāĻžāĻāĻļāύ āĻšāϞ āĻāĻŽāύ āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻļāύ āϝāĻž _āϏāĻŦāϏāĻŽāϝāĻŧ_ āĻāĻāĻ āĻĢāϞāĻžāĻĢāϞ āĻĒā§āϰāĻĻāĻžāύ āĻāϰā§, āϝāĻĻāĻŋ āĻāĻāĻ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻĒāĻžāϏ āĻāϰāĻž āĻšāϝāĻŧāĨ¤
-The `sum` function always returns the same result. If we pass `1` and `2`, it will _always_ return `3` without side effects. If we pass `5` and `10`, it will _always_ return `15`, and so on. This is the definition of a pure function.
+`sum` āĻĢāĻžāĻāĻļāύ āϏāĻŦāϏāĻŽāϝāĻŧ āĻāĻāĻ āĻĢāϞāĻžāĻĢāϞ āĻĒā§āϰāĻĻāĻžāύ āĻāϰā§āĨ¤ āϝāĻĻāĻŋ āĻāĻŽāϰāĻž `1` āĻāĻŦāĻ `2` āĻĒāĻžāϏ āĻāϰāĻŋ, āĻāĻāĻŋ _āϏāĻŦāϏāĻŽāϝāĻŧ_ āĻĒāĻžāϰā§āĻļā§āĻŦ āĻĒā§āϰāϤāĻŋāĻā§āϰāĻŋāϝāĻŧāĻž āĻāĻžāĻĄāĻŧāĻžāĻ `3` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ āϝāĻĻāĻŋ āĻāĻŽāϰāĻž `5` āĻāĻŦāĻ `10` āĻĒāĻžāϏ āĻāϰāĻŋ, āϤāĻžāĻšāϞ⧠āĻāĻāĻŋ _āϏāĻŦāϏāĻŽāϝāĻŧ_ `15` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§, āĻāϤā§āϝāĻžāĻĻāĻŋāĨ¤ āĻāĻāĻŋāĻ āĻšāϞ⧠āĻāĻāĻāĻŋ āĻŦāĻŋāĻļā§āĻĻā§āϧ āĻĢāĻžāĻāĻļāύā§āϰ āϏāĻāĻā§āĻāĻžāĨ¤
@@ -2518,15 +2518,17 @@ console.log(addFunction(5 * 2));
#### āĻāϤā§āϤāϰ: C
-The `add` function is a _memoized_ function. With memoization, we can cache the results of a function in order to speed up its execution. In this case, we create a `cache` object that stores the previously returned values.
+`add` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāĻāĻāĻŋ _memoized_ āĻĢāĻžāĻāĻļāύāĨ¤ āĻŽā§āĻŽā§āĻžāĻāĻāĻā§āĻļāύā§āϰ āϏāĻžāĻšāĻžāϝā§āϝā§, āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻļāύā§āϰ āĻĢāϞāĻžāĻĢāϞāĻā§āϞāĻŋ āĻā§āϝāĻžāĻļ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ (āĻāĻŦāĻŋāώā§āϝāϤ⧠āĻŦā§āϝāĻŦāĻšāĻžāϰā§āϰ āĻāύā§āϝ āĻāϞāĻžāĻĻāĻžāĻāĻžāĻŦā§ āϏāĻāϰāĻā§āώāĻŖ āĻāϰāĻžāϰ āĻĒāĻĻā§āϧāϤāĻŋ) āϝāĻžāϤ⧠āĻāĻāĻŋ āĻāĻžāϰā§āϝāĻāϰ āĻāϰāĻžāϰ (execution) āĻāϤāĻŋ āĻŦāĻžāĻĄāĻŧāĻžāύ⧠āϝāĻžāϝāĻŧāĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ `cache` āĻ
āĻŦāĻā§āĻā§āĻ āϤā§āϰāĻŋ āĻāϰā§āĻāĻŋ āϝāĻž āĻĒā§āϰā§āĻŦā§āϰ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻā§āϝāĻžāϞā§āĻā§āϞ⧠āϏāĻāϰāĻā§āώāĻŖ āĻāϰā§āĨ¤
-If we call the `addFunction` function again with the same argument, it first checks whether it has already gotten that value in its cache. If that's the case, the cache value will be returned, which saves execution time. Otherwise, if it's not cached, it will calculate the value and store it afterward.
+> āϝā§āĻšā§āϤ⧠āĻāĻāĻžāύ⧠`add` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻ
āύā§āϝ āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻļāύāĻā§ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§ āϝ⧠āϤāĻžāϰ āϏā§āĻā§āĻĒā§āϰ āĻŦāĻžāĻšāĻŋāϰā§āϰ āĻā§āϝāĻžāϞā§,`cache` āĻ
āĻŦāĻā§āĻā§āĻāĻā§, āĻāĻā§āϏā§āϏ āĻāϰāĻā§āĨ¤ āĻĢāϞ⧠āĻāĻāĻžāύ⧠āĻāĻāĻāĻŋ [āĻā§āϞā§āĻāĻžāϰ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures) āϤā§āϰāĻŋ āĻšā§ā§āĻā§āĨ¤
-We call the `addFunction` function three times with the same value: on the first invocation, the value of the function when `num` is equal to `10` isn't cached yet. The condition of the if-statement `num in cache` returns `false`, and the else block gets executed: `Calculated! 20` gets logged, and the value of the result gets added to the cache object. `cache` now looks like `{ 10: 20 }`.
+āϝāĻĻāĻŋ āĻāĻŽāϰāĻž āĻāĻāĻ āĻāϰā§āĻā§āĻŽā§āύā§āĻā§āϰ āϏāĻžāĻĨā§ āĻāĻŦāĻžāϰ `addFunction` āĻĢāĻžāĻāĻļāύāĻā§ āĻāϞ āĻāϰāĻŋ, āĻāĻāĻŋ āĻĒā§āϰāĻĨāĻŽā§ āĻĒāϰā§āĻā§āώāĻž āĻāϰ⧠āϝ⧠āϏā§āĻ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāϤāĻŋāĻŽāϧā§āϝ⧠cache-āĻĨā§āĻā§ āĻĒā§āϝāĻŧā§āĻā§ āĻāĻŋāύāĻžāĨ¤ āϝāĻĻāĻŋ āĻĒāĻžā§, cache-āĻĨā§āĻā§āĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻšāĻŦā§, āϝāĻž āĻāĻā§āϏāĻŋāĻāĻŋāĻāĻļāύā§āϰ āϏāĻŽāϝāĻŧ āĻŦāĻžāĻāĻāĻžāϝāĻŧāĨ¤ āĻ
āύā§āϝāĻĨāĻžāϝāĻŧ, cache-āĻĨā§āĻā§ āύāĻž āĻĒā§āϞā§, āĻāĻāĻŋ āĻāĻŖāύāĻž āĻāϰ⧠āĻĒā§āϰāĻžāĻĒā§āϤ āĻā§āϝāĻžāϞā§āĻāĻŋ āϏāĻāϰāĻā§āώāĻŖ āĻāϰāĻŦā§āĨ¤
-The second time, the `cache` object contains the value that gets returned for `10`. The condition of the if-statement `num in cache` returns `true`, and `'From cache! 20'` gets logged.
+āĻāĻŽāϰāĻž āĻāĻāĻ āĻā§āϝāĻžāϞ⧠āĻĻāĻŋā§ā§ `addFunction` āĻĢāĻžāĻāĻļāύāĻā§ āĻāϞ āĻāϰāĻāĻŋ ā§Š āĻŦāĻžāϰāĻ ā§§āĻŽ āĻāϞā§āϰ āϏāĻŽā§, āĻĢāĻžāĻāĻļāύā§āϰ āĻā§āϝāĻžāϞ⧠cache-āĻ āύā§āĻ āϝāĻāύ `num` āϏāĻŽāĻžāύ āϏāĻŽāĻžāύ āĻšā§ `10`āĨ¤ āĻāĻĢ-āϏā§āĻā§āĻāĻŽā§āϝāĻžāύā§āĻā§āϰ āĻļāϰā§āϤ `num in cache` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`false`, āĻāĻŦāĻ āĻāϞāϏ āĻŦā§āϞāĻ āĻāĻā§āϏāĻŋāĻāĻŋāĻāĻ āĻšā§ā§āĻā§āĻ `Calculated! 20` āϞāĻ āĻšā§, āĻāĻŦāĻ result-āĻāϰ āĻā§āϝāĻžāϞ⧠cache āĻ
āĻŦāĻā§āĻā§āĻā§ āϏāĻāϰāĻā§āώāĻŋāϤ āĻšā§āĨ¤ `cache` āĻāĻāύ āĻšā§ - `{ 10: 20 }`āĨ¤
-The third time, we pass `5 * 2` to the function which gets evaluated to `10`. The `cache` object contains the value that gets returned for `10`. The condition of the if-statement `num in cache` returns `true`, and `'From cache! 20'` gets logged.
+⧍⧠āĻŦāĻžāϰā§, `cache` āĻ
āĻŦāĻā§āĻā§āĻā§ `10` āĻāϰ āĻāύā§āϝ āϝ⧠āĻā§āϝāĻžāϞā§āĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻšā§ā§āĻāĻŋāϞ⧠āϏā§āĻāĻŋ āĻāĻā§āĨ¤ āĻāĻĢ-āϏā§āĻā§āĻāĻŽā§āϝāĻžāύāύā§āĻā§āϰ āĻļāϰā§āϤ `num in cache` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`true`, āĻāĻŦāĻ āϞāĻ āĻšā§ `'From cache! 20'`āĨ¤
+
+ā§Šā§ āĻŦāĻžāϰā§, āĻĢāĻžāĻāĻļāύ⧠āĻāĻŽāϰāĻž āĻĒāĻžāϏ āĻāϰā§āĻāĻŋ `5 * 2` āϝā§āĻāĻž āĻŽā§āϞā§āϝāĻžā§āĻŋāϤ āĻšā§ `10`āĨ¤ `cache` āĻ
āĻŦāĻā§āĻā§āĻā§ `10` āĻāϰ āĻāύā§āϝ āϝ⧠āĻā§āϝāĻžāϞā§āĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻšā§ā§āĻāĻŋāϞ⧠āϏā§āĻāĻŋ āĻāĻā§āĨ¤ āĻāĻĢ-āϏā§āĻā§āĻāĻŽā§āϝāĻžāύāύā§āĻā§āϰ āĻļāϰā§āϤ `num in cache` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`true`, āĻāĻŦāĻ āϞāĻ āĻšā§ `'From cache! 20'`āĨ¤
@@ -2557,13 +2559,13 @@ for (let item of myLifeSummedUp) {
#### āĻāϤā§āϤāϰ: A
-With a _for-in_ loop, we can iterate over **enumerable** properties. In an array, the enumerable properties are the "keys" of array elements, which are actually their indexes. You could see an array as:
+āĻāĻāĻāĻŋ _for-in_ āϞā§āĻĒ āĻĻāĻŋāϝāĻŧā§, āĻāĻŽāϰāĻž **āĻāĻŖāύāĻžāϝā§āĻā§āϝ (enumerable)** āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻāĻĒāϰ āϞā§āĻĒ āĻāĻžāϞāĻžāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻ
ā§āϝāĻžāϰā§āϤ⧠āĻāĻŖāύāĻžāϝā§āĻā§āϝ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻā§āϞ⧠āĻšā§ āĻ
ā§āϝāĻžāϰā§āϰ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ "āĻā§", āϝāĻž āĻāϏāϞ⧠āϤāĻžāĻĻā§āϰ āĻāύāĻĄā§āĻā§āϏāĨ¤ āĻāĻĒāύāĻŋ āĻ
ā§āϝāĻžāϰā§āĻāĻŋāĻā§ āĻĻā§āĻāϤ⧠āĻĒāĻžāĻŦā§āύ āĻāĻŽāύ:
`{0: "â", 1: "đģ", 2: "đˇ", 3: "đĢ"}`
-Where the keys are the enumerable properties. `0` `1` `2` `3` get logged.
+āϝā§āĻāĻžāύ⧠āĻā§āĻā§āϞāĻŋ āĻāĻŖāύāĻžāϝā§āĻā§āϝ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĨ¤ āϤāĻžāĻ `0` `1` `2` `3` āϞāĻ āĻšā§ā§āĻā§āĨ¤
-With a _for-of_ loop, we can iterate over **iterables**. An array is an iterable. When we iterate over the array, the variable "item" is equal to the element it's currently iterating over, `"â"` `"đģ"` `"đˇ"` `"đĢ"` get logged.
+āĻāĻāĻāĻŋ _for-of_ āϞā§āĻĒ āĻĻāĻŋāϝāĻŧā§, āĻāĻŽāϰāĻž **āĻĒā§āύāϰāĻžāĻŦā§āϤā§āϤāĻŋāϝā§āĻā§āϝ (iteables)** āĻāϰ āĻāĻĒāϰ āϞā§āĻĒ āĻāĻžāϞāĻžāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻ
ā§āϝāĻžāϰ⧠āĻĒā§āύāϰāĻžāĻŦā§āϤā§āϤāĻŋāϝā§āĻā§āϝāĨ¤ āϝāĻāύ āĻāĻŽāϰāĻž āĻ
ā§āϝāĻžāϰā§āϰ āĻāĻĒāϰ āϞā§āĻĒ āĻāĻžāϞāĻžāĻ, āϤāĻāύ "item" āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞāĻāĻŋ āĻŦāϰā§āϤāĻŽāĻžāύ⧠āĻĒā§āύāϰāĻžāĻŦā§āϤā§āϤāĻŋ āĻšāĻā§āĻā§ āϏā§āĻ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āϏāĻŽāĻžāύāĨ¤ āϤāĻžāĻ `"â"` `"đģ"` `"đˇ"` `"đĢ"` āϞāĻ āĻšāϝāĻŧā§āĻā§āĨ¤
@@ -2587,9 +2589,9 @@ console.log(list);
#### āĻāϤā§āϤāϰ: C
-Array elements can hold any value. Numbers, strings, objects, other arrays, null, boolean values, undefined, and other expressions such as dates, functions, and calculations.
+āĻ
ā§āϝāĻžāϰ⧠āĻāϞāĻŋāĻŽā§āύā§āĻāĻā§āϞ⧠āϝā§āĻā§āύ āĻāĻžāĻāĻĒā§āϰ āĻā§āϝāĻžāϞ⧠āϰāĻžāĻāϤ⧠āĻĒāĻžāϰā§āĨ¤ āύāĻžāĻŽā§āĻŦāĻžāϰ, āϏā§āĻā§āϰāĻŋāĻ, āĻ
āĻā§āĻā§āĻā§āĻ, āĻ
āύā§āϝ āĻ
ā§āϝāĻžāϰā§, āύāĻžāϞ, āĻŦā§āϞāĻŋā§āĻžāύ, āĻāύā§āĻĄāĻŋāĻĢāĻžāĻāύā§āĻĄ, āĻāĻŦāĻ āĻ
āύā§āϝāĻžāύā§āϝ āĻāĻā§āϏāĻĒā§āϰā§āĻļāύ āϝā§āĻŽāύ, āϤāĻžāϰāĻŋāĻ, āĻĢāĻžāĻāĻļāύ, āĻ āϝā§āĻā§āϞ⧠āĻāύāύāĻž āϝā§āĻā§āϝāĨ¤
-The element will be equal to the returned value. `1 + 2` returns `3`, `1 * 2` returns `2`, and `1 / 2` returns `0.5`.
+āĻāϞāĻŋāĻŽā§āύā§āĻāĻā§āϞ⧠āϏāĻŽāĻžāύ āĻšāĻŦā§ āϤāĻžāϰ āϰāĻŋāĻāĻžāϰā§āύ āĻā§āϝāĻžāϞā§āĨ¤ `1 + 2` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`3`, `1 * 2` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`2`, āĻāĻŦāĻ `1 / 2` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`0.5`āĨ¤
From dcc887f101c631e38b354b39dea6305acb91e823 Mon Sep 17 00:00:00 2001
From: iamsaief
Date: Tue, 4 Jun 2024 07:54:11 +0600
Subject: [PATCH 06/12] added translation till 90
---
bn-BD/README_bn-BD.md | 64 +++++++++++++++++++++----------------------
1 file changed, 32 insertions(+), 32 deletions(-)
diff --git a/bn-BD/README_bn-BD.md b/bn-BD/README_bn-BD.md
index f292c293..ac3379fe 100644
--- a/bn-BD/README_bn-BD.md
+++ b/bn-BD/README_bn-BD.md
@@ -2486,7 +2486,7 @@ function sum(a, b) {
---
-###### 78. What is the output?
+###### 78. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
const add = () => {
@@ -2535,7 +2535,7 @@ console.log(addFunction(5 * 2));
---
-###### 79. What is the output?
+###### 79. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
const myLifeSummedUp = ['â', 'đģ', 'đˇ', 'đĢ'];
@@ -2572,7 +2572,7 @@ for (let item of myLifeSummedUp) {
---
-###### 80. What is the output?
+###### 80. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
const list = [1 + 2, 1 * 2, 1 / 2];
@@ -2598,7 +2598,7 @@ console.log(list);
---
-###### 81. What is the output?
+###### 81. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
function sayHi(name) {
@@ -2618,20 +2618,20 @@ console.log(sayHi());
#### āĻāϤā§āϤāϰ: B
-By default, arguments have the value of `undefined`, unless a value has been passed to the function. In this case, we didn't pass a value for the `name` argument. `name` is equal to `undefined` which gets logged.
+āĻĄāĻŋāĻĢāϞā§āĻāĻāĻžāĻŦā§, āĻāϰā§āĻā§āĻŽā§āύā§āĻāĻā§āϞā§āϰ āĻā§āϝāĻžāϞ⧠āĻĨāĻžāĻā§ `undefined`, āϝāĻĻāĻŋ āĻĢāĻžāĻāĻļāύ⧠āĻā§āύ āĻāĻāĻāĻŋ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻž āύāĻž āĻšā§āĨ¤ āĻāĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž `name` āĻāϰā§āĻā§āĻŽā§āύā§āĻā§āϰ āĻāύā§āϝ āĻā§āύ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻŋ āύāĻŋāĨ¤ `name` āϏāĻŽāĻžāύ āĻšā§ `undefined`, āϝā§āĻāĻŋ āϞāĻ āĻšā§ā§āĻā§āĨ¤
-In ES6, we can overwrite this default `undefined` value with default parameters. For example:
+āĻāĻāϏā§Ŧ āĻ, āĻāĻŽāϰāĻž āĻāĻ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞ⧠`undefined` āĻā§ āĻāĻāĻžāϰāϰāĻžāĻāĻ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ āĻĄāĻŋāĻĢāϞā§āĻ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ āĻĻāĻŋā§ā§āĨ¤ āĻāĻĻāĻžāĻšāϰāύāϏāϰā§āĻĒāĻ
`function sayHi(name = "Lydia") { ... }`
-In this case, if we didn't pass a value or if we passed `undefined`, `name` would always be equal to the string `Lydia`
+āĻāĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž āϝāĻĻāĻŋ āĻā§āύ āĻāĻāĻāĻŋ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āύāĻž āĻāϰāĻŋ āĻŦāĻž `undefined` āĻĒāĻžāϏ āĻāϰāĻŋ, `name` āĻāϰ āĻā§āϝāĻžāϞ⧠āϏāĻŦāϏāĻŽā§ `Lydia` āϏā§āĻā§āϰāĻŋāĻāĻāĻŋāϰ āϏāĻŽāĻžāύ āĻšāĻŦā§āĨ¤
---
-###### 82. What is the output?
+###### 82. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
var status = 'đ';
@@ -2661,16 +2661,16 @@ setTimeout(() => {
#### āĻāϤā§āϤāϰ: B
-The value of the `this` keyword is dependent on where you use it. In a **method**, like the `getStatus` method, the `this` keyword refers to _the object that the method belongs to_. The method belongs to the `data` object, so `this` refers to the `data` object. When we log `this.status`, the `status` property on the `data` object gets logged, which is `"đĨ"`.
+`this` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄā§āϰ āĻŽāĻžāύ āύāĻŋāϰā§āĻāϰ āĻāϰ⧠āĻāĻĒāύāĻŋ āĻāĻāĻŋ āĻā§āĻĨāĻžāϝāĻŧ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻā§āύ āϤāĻžāϰ āĻāĻĒāϰāĨ¤ āĻāĻāĻāĻŋ **āĻŽā§āĻĨāĻĄā§**-āĻ, āϝā§āĻŽāύ `getStatus` āĻŽā§āĻĨāĻĄā§, `this` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄāĻāĻŋ _āϏā§āĻ āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āĻŦā§āĻāĻžā§ āĻŽā§āĻĨāĻĄāĻāĻŋ āϝāĻžāϰ āĻā§āϤāϰ⧠āĻĨāĻžāĻā§_āĨ¤ āĻŽā§āĻĨāĻĄāĻāĻŋ `data` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻ
āύā§āϤāϰā§āĻāϤ, `this` āϤāĻžāĻ `data` āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āϰā§āĻĢāĻžāϰ āĻāϰā§āĨ¤ āϝāĻāύ āĻāĻŽāϰāĻž `this.status` āϞāĻ āĻāϰāĻŋ, `data` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `status` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āϞāĻ āĻšāϝāĻŧ, āϝāĻžāϰ āĻā§āϝāĻžāϞ⧠`"đĨ"`āĨ¤
-With the `call` method, we can change the object to which the `this` keyword refers. In **functions**, the `this` keyword refers to the _the object that the function belongs to_. We declared the `setTimeout` function on the _global object_, so within the `setTimeout` function, the `this` keyword refers to the _global object_. On the global object, there is a variable called _status_ with the value of `"đ"`. When logging `this.status`, `"đ"` gets logged.
+`call` āĻŽā§āĻĨāĻĄā§āϰ āĻŽāĻžāϧā§āϝāĻŽā§, āĻāĻŽāϰāĻž āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ `this` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄāĻāĻŋ āϝāĻžāĻā§ āϰā§āĻĢāĻžāϰ āĻāϰā§āĨ¤ **āĻĢāĻžāĻāĻļāύ**-āĻ, `this` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄāĻāĻŋ _āϏā§āĻ āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āĻŦā§āĻāĻžāϝāĻŧ āϝā§āĻāĻŋ āĻĢāĻžāĻāĻļāύāĻāĻŋāϰ āĻ
āύā§āϤāϰā§āĻāϤ_āĨ¤ āĻāĻŽāϰāĻž _āĻā§āϞā§āĻŦāĻžāϞ āĻ
āĻŦāĻā§āĻā§āĻ_-āĻ `setTimeout` āĻĢāĻžāĻāĻļāύ āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰā§āĻāĻŋ, āϤāĻžāĻ `setTimeout` āĻĢāĻžāĻāĻļāύā§āϰ āĻŽāϧā§āϝā§, `this` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄāĻāĻŋ _āĻā§āϞā§āĻŦāĻžāϞ āĻ
āĻŦāĻā§āĻā§āĻ_ āĻā§ āϰā§āĻĢāĻžāϰ āĻāϰā§āĨ¤ āĻā§āϞā§āĻŦāĻžāϞ āĻ
āĻŦāĻā§āĻā§āĻā§, _status_ āύāĻžāĻŽāĻ āĻāĻāĻāĻŋ āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ āĻāĻā§ āϝāĻžāϰ āĻā§āϝāĻžāϞ⧠`"đ"`āĨ¤ āϤāĻžāĻ `this.status` āϞāĻ āĻāϰāĻžā§ `"đ"` āϞāĻ āĻšā§āĨ¤
---
-###### 83. What is the output?
+###### 83. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
const person = {
@@ -2694,20 +2694,20 @@ console.log(person);
#### āĻāϤā§āϤāϰ: A
-We set the variable `city` equal to the value of the property called `city` on the `person` object. There is no property on this object called `city`, so the variable `city` has the value of `undefined`.
+āĻāĻŽāϰāĻž `city` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞā§āϰ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻāĻŋ `person` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `city` āύāĻžāĻŽāĻ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞā§āĻā§āĨ¤ āĻāĻ āĻ
āĻŦāĻā§āĻā§āĻā§ `city` āύāĻžāĻŽāĻ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āύā§āĻ, āϤāĻžāĻ `city` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞā§āϰ āĻā§āϝāĻžāϞ⧠āĻĨāĻžāĻāĻā§ `undefined`āĨ¤
-Note that we are _not_ referencing the `person` object itself! We simply set the variable `city` equal to the current value of the `city` property on the `person` object.
+āĻā§ā§āĻžāϞ āĻāϰā§āύ āĻāĻŽāϰāĻž āĻāĻŋāύā§āϤ⧠`person` āĻ
āĻŦāĻā§āĻā§āĻāĻŋāĻā§ āϰā§āĻĢāĻžāϰā§āύā§āϏ (āύāĻŋāϰā§āĻĻā§āĻļ) _āĻāϰāĻāĻŋ āύāĻž_! āĻāĻŽāϰāĻž āϏāĻžāϧāĻžāϰāύ āĻāĻžāĻŦā§āĻ `city` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞā§āϰ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻāĻŋ `person` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `city` āύāĻžāĻŽāĻ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻŦāϰā§āϤāĻŽāĻžāύ āĻā§āϝāĻžāϞā§āĻā§āĨ¤
-Then, we set `city` equal to the string `"Amsterdam"`. This doesn't change the person object: there is no reference to that object.
+āĻĒāϰāĻŦāϰā§āϤāĻŋāϤā§, `city` āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻāĻŋ āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ-`"Amsterdam"`āĨ¤ āĻāĻāĻž person āĻ
āĻŦāĻā§āĻā§āĻā§ āĻā§āύ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāĻā§ āύāĻžāĻ āĻāĻāĻžāύ⧠āĻ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻā§āύ āϰā§āĻĢāĻžāϰā§āύā§āϏ āύā§āĻāĨ¤
-When logging the `person` object, the unmodified object gets returned.
+āϝāĻāύ `person` āĻ
āĻŦāĻā§āĻā§āĻāĻŋāĻā§ āϞāĻ āĻāϰāĻž āĻšā§ā§āĻā§, āĻ
āĻĒāϰāĻŋāĻŦāϰā§āϤāĻŋāϤ āĻ
āĻŦāĻā§āĻā§āĻāĻŋāĻ āϰāĻŋāĻāĻžāϰā§āύ āĻšā§ā§āĻā§āĨ¤
---
-###### 84. What is the output?
+###### 84. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
function checkAge(age) {
@@ -2733,14 +2733,14 @@ console.log(checkAge(21));
#### āĻāϤā§āϤāϰ: C
-Variables with the `const` and `let` keywords are _block-scoped_. A block is anything between curly brackets (`{ }`). In this case, the curly brackets of the if/else statements. You cannot reference a variable outside of the block it's declared in, a ReferenceError gets thrown.
+`const` āĻ `let` āĻāĻŋāĻā§āĻžāϰā§āĻĄ āĻĻāĻŋā§ā§ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻā§āϞ⧠āĻšā§ _āĻŦā§āϞāĻ-āϏā§āĻā§āĻĒāĻĄ_āĨ¤ āĻāĻāĻāĻŋ āĻŦā§āϞāĻ āĻšāϞ⧠āĻāĻžāϰā§āϞāĻŋ āĻŦā§āϰā§āϝāĻžāĻā§āĻā§āϰ (`{ }`) āĻā§āϤāϰā§āϰ āϝā§āĻā§āύ āĻāĻŋāĻā§āĻāĨ¤ āĻāĻā§āώā§āϤā§āϰā§, āĻāĻĢ-āĻāϞāϏ āϏā§āĻā§āĻāĻŽā§āύā§āĻā§āϰ āĻāĻžāϰā§āϞāĻŋ āĻŦā§āϰā§āϝāĻžāĻā§āĻāĨ¤ āĻāĻĒāύāĻŋ āĻā§āύ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻā§ āϝ⧠āĻŦā§āϞāĻā§ āϤāĻžāĻĻā§āϰ āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰāĻž āĻšā§ā§āĻā§ āϤāĻžāϰ āĻŦāĻžāĻāϰ⧠āĻĨā§āĻā§ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŦā§āύ āύāĻž, āĻāĻāĻāĻŋ ReferenceError āĻšā§āĨ¤
---
-###### 85. What kind of information would get logged?
+###### 85. āĻāĻāĻžāύ⧠āĻāĻŋ āϧāϰāύā§āϰ āϤāĻĨā§āϝ āϞāĻ āĻšāϤ⧠āĻĒāĻžāϰā§?
```javascript
fetch('https://www.website.com/api/user/1')
@@ -2758,14 +2758,14 @@ fetch('https://www.website.com/api/user/1')
#### āĻāϤā§āϤāϰ: C
-The value of `res` in the second `.then` is equal to the returned value of the previous `.then`. You can keep chaining `.then`s like this, where the value is passed to the next handler.
+⧍āϝāĻŧ `.then`-āĻ `res` āĻāϰ āĻā§āϝāĻžāϞ⧠āĻĒā§āϰā§āĻŦāĻŦāϰā§āϤ⧠`.then`-āĻāϰ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻā§āϝāĻžāϞā§āϰ āϏāĻŽāĻžāύāĨ¤ āĻāĻĒāύāĻŋ āĻāĻāĻžāĻŦā§ `.then`-āĻā§āϞā§āϰ āĻā§āĻāύ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύ, āϝā§āĻāĻžāύ⧠āĻŦāϰā§āϤāĻŽāĻžāύ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻĒāϰāĻŦāϰā§āϤ⧠āĻšā§āϝāĻžāύā§āĻĄāϞāĻžāϰā§āϰ āĻāĻžāĻā§ āĻāϞ⧠āϝāĻžāϝāĻŧāĨ¤
---
-###### 86. Which option is a way to set `hasName` equal to `true`, provided you cannot pass `true` as an argument?
+###### 86. āĻā§āύ āĻ
āĻĒāĻļāύāĻāĻŋ `hasName` āĻā§ `true` āĻāϰ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻžāϰ āĻāĻāĻāĻŋ āĻāĻĒāĻžāϝāĻŧ, āϝāĻĻāĻŋ āĻāĻĒāύāĻŋ `true` āĻā§ āĻāĻāĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻšāĻŋāϏā§āĻŦā§ āĻĒāĻžāϏ āĻāϰāϤ⧠āύāĻž āĻĒāĻžāϰā§āύ?
```javascript
function getName(name) {
@@ -2783,13 +2783,13 @@ function getName(name) {
#### āĻāϤā§āϤāϰ: A
-With `!!name`, we determine whether the value of `name` is truthy or falsy. If the name is truthy, which we want to test for, `!name` returns `false`. `!false` (which is what `!!name` practically is) returns `true`.
+A-āϰ āĻā§āώā§āϤā§āϰā§, `!!name` āĻĻāĻŋāϝāĻŧā§, āĻāĻŽāϰāĻž āύāĻŋāϰā§āϧāĻžāϰāĻŖ āĻāϰāĻŋ `name` āĻāϰ āĻā§āϝāĻžāϞ⧠āϏāϤā§āϝ āύāĻžāĻāĻŋ āĻŽāĻŋāĻĨā§āϝāĻžāĨ¤ āϝāĻĻāĻŋ āύāĻžāĻŽāĻāĻŋ āϏāϤā§āϝ āĻšāϝāĻŧ, āϝāĻžāϰ āĻāύā§āϝ āĻāĻŽāϰāĻž āĻĒāϰā§āĻā§āώāĻž āĻāϰāϤ⧠āĻāĻžāĻ, `!name` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`false`āĨ¤ `!false` (āϝā§āĻāĻŋ āĻŦāĻžāϏā§āϤāĻŦāĻŋāĻāĻāĻžāĻŦā§āĻ `!!name`) āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`true`āĨ¤
-By setting `hasName` equal to `name`, you set `hasName` equal to whatever value you passed to the `getName` function, not the boolean value `true`.
+B-āϰ āĻā§āώā§āϤā§āϰā§, `hasName` āϏāĻŽāĻžāύ `name` āϏā§āĻ āĻāϰāĻžāϰ āĻŽāĻžāϧā§āϝāĻŽā§, āĻāĻĒāύāĻŋ `hasName` āϏāĻŽāĻžāύ āĻāϰāĻā§āύ `getName` āĻĢāĻžāĻāĻļāύ⧠āĻĒāĻžāϏ āĻāϰāĻž āϝā§āĻā§āύ āĻā§āϝāĻžāϞā§, āĻŦā§āϞāĻŋāϝāĻŧāĻžāύ `true` āĻā§āϝāĻžāϞ⧠āύāϝāĻŧāĨ¤
-`new Boolean(true)` returns an object wrapper, not the boolean value itself.
+C-āϰ āĻā§āώā§āϤā§āϰā§, `new Boolean(true)` āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻ āϰâā§āϝāĻžāĻĒāĻžāϰ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§, āϤāĻžāϰ āĻŦā§āϞāĻŋāϝāĻŧāĻžāύ āĻā§āϝāĻžāϞā§āĻā§ āύāϝāĻŧāĨ¤
-`name.length` returns the length of the passed argument, not whether it's `true`.
+D-āϰ āĻā§āώā§āϤā§āϰā§, `name.length` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠āĻĒāĻžāϏ āĻāϰāĻž āĻāϰā§āĻā§āĻŽā§āύā§āĻā§āϰ āĻĻā§āϰā§āĻā§āϝ, āĻāĻāĻŋ `true` āĻāĻŋāύāĻž āϤāĻž āύāϝāĻŧāĨ¤
@@ -2812,9 +2812,9 @@ console.log('I want pizza'[0]);
#### āĻāϤā§āϤāϰ: B
-In order to get a character at a specific index of a string, you can use bracket notation. The first character in the string has index 0, and so on. In this case, we want to get the element with index 0, the character `"I'`, which gets logged.
+āϏā§āĻā§āϰāĻŋ-āĻāϰ āĻā§āύ āύāĻŋāϰā§āĻĻāĻŋāώā§āĻ āĻāύāĻĄā§āĻā§āϏā§āϰ āĻ
āĻā§āώāϰāĻā§ āĻĒāĻžāĻā§āĻžāϰ āĻāύā§āϝ, āĻāĻĒāύāĻŋ āĻŦā§āϰā§āϝāĻžāĻā§āĻ āύā§āĻā§āĻļāύ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤ āϏā§āĻā§āϰāĻŋ-āĻāϰ ā§§āĻŽ āĻ
āĻā§āώāϰā§āϰ āĻāύāĻĄā§āĻā§āϏ āĻšā§ 0, āĻāĻŦāĻ āĻāĻāĻžāĻŦā§ āĻĒāϰā§āϰ āĻāύāĻĄā§āĻā§āϏāĻā§āϞā§āϤ⧠āĻŦāĻžāĻāĻŋ āĻ
āĻā§āώāϰāĻā§āϞ⧠āĻĨāĻžāĻā§āĨ¤ āĻāĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž 0 āĻāύāĻĄā§āĻā§āϏā§āϰ āĻāϞāĻŋāĻŽā§āύā§āĻāĻā§ āĻĒā§āϤ⧠āĻāĻžāĻā§āĻāĻŋ, `"I'` āĻ
āĻā§āώāϰāĻāĻŋ, āϝā§āĻāĻž āϞāĻ āĻšā§ā§āĻā§āĨ¤
-Note that this method is not supported in IE7 and below. In that case, use `.charAt()`.
+āĻŽāύ⧠āϰāĻžāĻāĻŦā§āύ āϝ⧠āĻāĻ āĻŽā§āĻĨāĻĄāĻāĻŋ IE7 āĻāĻŦāĻ āύā§āĻā§ āϏāĻžāĻĒā§āϰā§āĻ āĻāϰ⧠āύāĻžāĨ¤ āϏā§āĻā§āώā§āϤā§āϰ⧠`.charAt()` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§āύāĨ¤
@@ -2841,9 +2841,9 @@ sum(10);
#### āĻāϤā§āϤāϰ: B
-You can set a default parameter's value equal to another parameter of the function, as long as they've been defined _before_ the default parameter. We pass the value `10` to the `sum` function. If the `sum` function only receives 1 argument, it means that the value for `num2` is not passed, and the value of `num1` is equal to the passed value `10` in this case. The default value of `num2` is the value of `num1`, which is `10`. `num1 + num2` returns `20`.
+āĻāĻĒāύāĻŋ āĻĢāĻžāĻāĻļāύā§āϰ āĻĄāĻŋāĻĢāϞā§āĻ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰā§āϰ āĻā§āϝāĻžāϞā§āĻā§ āϏāĻŽāĻžāύ āĻ
āύā§āϝ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŦā§āύ, āϝāϤāĻā§āώāĻŖ āĻĒāϰā§āϝāύā§āϤ āϤāĻžāϰāĻž āĻĄāĻŋāĻĢāϞā§āĻ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰā§āϰ _āĻāĻā§_ āĻĄāĻŋāĻĢāĻžāĻāύ āĻāϰāĻž āĻĨāĻžāĻā§āĨ¤ āĻāĻŽāϰāĻž `sum` āĻĢāĻžāĻāĻļāύ⧠`10` āĻā§āϝāĻžāϞā§āĻā§ āĻĒāĻžāϏ āĻāϰāĻāĻŋāĨ¤ āϝāĻĻāĻŋ `sum` āĻĢāĻžāĻāĻļāύ āĻāĻāĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āϰāĻŋāϏāĻŋāĻ āĻāϰā§, āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ⧠`num2` āĻāϰ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻž āĻšā§āύāĻŋ, āĻāĻŦāĻ `num1` āĻāϰ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āĻšāϞ āĻĒāĻžāϏ āĻāϰāĻž āĻā§āϝāĻžāϞā§āĻāĻŋ `10` āĻāĻā§āώā§āϤā§āϰā§āĨ¤ `num2` āĻāϰ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞ⧠āĻšāϞ `num1`, āϝā§āĻāĻž `10`āĨ¤ `num1 + num2` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĻā§ `20`āĨ¤
-If you're trying to set a default parameter's value equal to a parameter that is defined _after_ (to the right), the parameter's value hasn't been initialized yet, which will throw an error.
+āϝāĻĻāĻŋ āĻāĻĒāύāĻŋ āĻĄāĻŋāĻĢāϞā§āĻ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰā§āϰ āĻā§āϝāĻžāϞā§āĻā§ āϏāĻŽāĻžāύ āĻ
āύā§āϝ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ āĻāϰāϤ⧠āĻāĻžāύ āϝā§āĻāĻž _āĻĒāϰā§_ āĻĄāĻŋāĻĢāĻžāĻāύ āĻāϰāĻž āĻšā§ā§āĻā§ (āĻĄāĻžāύ āĻĒāĻžāĻļā§āϰ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ), āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰā§āϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āϤāĻāύ⧠āĻāύāĻŋāĻļāĻŋā§āĻžāϞāĻžāĻāĻ (āĻā§āϝāĻžāϞ⧠āϏā§āĻ āĻāϰāĻž) āĻšā§ āύāĻŋ, āϏā§āĻāĻŋ āĻāĻāĻāĻŋ āĻāϰāϰ āĻĨā§āϰ⧠āĻāϰāĻŦā§āĨ¤
@@ -2873,9 +2873,9 @@ console.log(data);
#### āĻāϤā§āϤāϰ: A
-With the `import * as name` syntax, we import _all exports_ from the `module.js` file into the `index.js` file as a new object called `data` is created. In the `module.js` file, there are two exports: the default export, and a named export. The default export is a function that returns the string `"Hello World"`, and the named export is a variable called `name` which has the value of the string `"Lydia"`.
+`import * as name` āϏāĻŋāύāĻā§āϝāĻžāĻā§āϏ āĻĻāĻŋā§ā§, āĻāĻŽāϰāĻž `module.js` āĻĢāĻžāĻāϞ āĻĨā§āĻā§ _āϏāĻāϞ āĻāĻā§āϏāĻĒā§āϰā§āĻ_-āĻā§āϞā§āĻā§ `index.js` āĻĢāĻžāĻāϞ⧠āĻāĻŽā§āĻĒā§āϰā§āĻ āĻāϰāĻāĻŋ `data` āύāĻžāĻŽā§āϰ āĻāĻāĻāĻŋ āύāϤā§āύ āĻ
āĻŦāĻā§āĻā§āĻ āĻšāĻŋāϏā§āĻŦā§āĨ¤ `module.js` āĻĢāĻžāĻāϞā§, āĻĻā§āĻāĻŋ āĻāĻā§āϏāĻĒā§āϰā§āĻ āĻāĻā§āĻ āĻĄāĻŋāĻĢāϞā§āĻ āĻāĻā§āϏāĻĒā§āϰā§āĻ āĻ āĻāĻāĻāĻŋ āύā§āĻŽāĻĄ āĻāĻā§āϏāĻĒā§āϰā§āĻāĨ¤ āĻĄāĻŋāĻĢāϞā§āĻ āĻāĻā§āϏāĻĒā§āϰā§āĻāĻāĻŋ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āĻĢāĻžāĻāĻļāύ āϝ⧠`"Hello World"` āϏā§āĻā§āϰāĻŋāĻāĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§, āĻāĻŦāĻ āύā§āĻŽāĻĄ āĻāĻā§āϏāĻĒā§āϰā§āĻāĻāĻŋ āĻšāϞ `name` āύāĻžāĻŽā§āϰ āĻāĻāĻŋ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞ āϝā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āĻšāϞ `"Lydia"` āϏā§āĻā§āϰāĻŋāĻāĻāĻŋāĨ¤
-The `data` object has a `default` property for the default export, other properties have the names of the named exports and their corresponding values.
+`data` āĻ
āĻŦāĻā§āĻā§āĻāĻāĻŋāϤ⧠āĻĄāĻŋāĻĢāϞā§āĻ āĻāĻā§āϏāĻĒā§āϰā§āĻā§āϰ āĻāύā§āϝ āĻāĻāĻāĻŋ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻāĻā§ `default`, āĻ
āύā§āϝāĻžāύā§āϝ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϤ⧠āĻāĻā§ āύā§āĻŽāĻĄ āĻāĻā§āϏāĻĒā§āϰā§āĻā§āϰ āύāĻžāĻŽāĻā§āϞ⧠āĻ āϤāĻžāĻĻā§āϰ āϏāĻāĻļā§āϞāĻŋāώā§āĻ āĻā§āϝāĻžāϞā§āĨ¤
@@ -2905,7 +2905,7 @@ console.log(typeof member);
#### āĻāϤā§āϤāϰ: C
-Classes are syntactical sugar for function constructors. The equivalent of the `Person` class as a function constructor would be:
+āĻā§āϞāĻžāϏāĻā§āϞāĻŋ āĻšāϞ⧠āĻĢāĻžāĻāĻļāύ āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰāĻĻā§āϰ āĻāύā§āϝ _āϏāĻŋāύāĻā§āϝāĻžāĻā§āĻāĻŋāĻ āϏā§āĻāĻžāϰ_āĨ¤ āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻļāύ āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰ āĻšāĻŋāϏā§āĻŦā§ `Person` āĻā§āϞāĻžāϏā§āϰ āϏāĻŽāϤā§āϞā§āϝ āĻšāĻŦā§ āĻāĻŽāύ:
```javascript
function Person(name) {
@@ -2913,7 +2913,7 @@ function Person(name) {
}
```
-Calling a function constructor with `new` results in the creation of an instance of `Person`, `typeof` keyword returns `"object"` for an instance. `typeof member` returns `"object"`.
+āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻļāύ āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰāĻā§ `new` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄ āĻĻāĻŋāϝāĻŧā§ āĻāϞ āĻāϰāĻžāϰ āĻĢāϞ⧠`Person` āĻāϰ āĻāĻāĻāĻŋ āĻāĻĻāĻžāĻšāϰāύ/āύāĻŋāĻĻāϰā§āĻļāύ (instance) āϤā§āϰāĻŋ āĻšāϝāĻŧ, `typeof` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄ āĻāĻāĻāĻŋ āĻāύā§āϏāĻā§āϝāĻžāύā§āϏā§āϰ āĻāύā§āϝ `"object"` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ `typeof member` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`"object"`, āϝā§āĻāĻž āϞāĻ āĻšā§āĨ¤
From beac838386130f8cb2e449c58509fd91755216bb Mon Sep 17 00:00:00 2001
From: iamsaief
Date: Fri, 7 Jun 2024 09:10:31 +0600
Subject: [PATCH 07/12] =?UTF-8?q?added=20translation=20till=20100!=20?=
=?UTF-8?q?=F0=9F=8E=89=E2=9C=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
bn-BD/README_bn-BD.md | 60 ++++++++++++++++++++++---------------------
1 file changed, 31 insertions(+), 29 deletions(-)
diff --git a/bn-BD/README_bn-BD.md b/bn-BD/README_bn-BD.md
index ac3379fe..3a1c2292 100644
--- a/bn-BD/README_bn-BD.md
+++ b/bn-BD/README_bn-BD.md
@@ -2938,9 +2938,9 @@ console.log(newList.push(5));
#### āĻāϤā§āϤāϰ: D
-The `.push` method returns the _new length_ of the array, not the array itself! By setting `newList` equal to `[1, 2, 3].push(4)`, we set `newList` equal to the new length of the array: `4`.
+`.push` āĻŽā§āĻĨāĻĄ āĻ
ā§āϝāĻžāϰā§āϰ āύāϤā§āύ āĻĻā§āϰā§āĻā§āϝ āĻĢā§āϰāϤ āĻĻā§āϝāĻŧ, āĻ
ā§āϝāĻžāϰā§āĻāĻŋāĻā§ āύāϝāĻŧ! `newList` āĻā§ `[1, 2, 3].push(4)` āĻāϰ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻžāϰ āĻŽāĻžāϧā§āϝāĻŽā§ āĻāĻŽāϰāĻž `newList` āĻā§ āĻ
ā§āϝāĻžāϰā§āϰ āύāϤā§āύ āĻĻā§āϰā§āĻā§āϝ `4` āĻāϰ āϏāĻŽāĻžāύ āĻāϰā§āĻāĻŋāĨ¤
-Then, we try to use the `.push` method on `newList`. Since `newList` is the numerical value `4`, we cannot use the `.push` method: a TypeError is thrown.
+āϤāĻžāϰāĻĒāϰ, āĻāĻŽāϰāĻž `.push` āĻŽā§āĻĨāĻĄāĻā§ `newList` āĻ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻŋāĨ¤ āϝā§āĻšā§āϤ⧠`newList` āĻšāϞ āĻāĻāĻāĻŋ āϏāĻāĻā§āϝāĻžāĻāϤ āĻŽāĻžāύ `4`, āϤāĻžāĻ āĻāĻŽāϰāĻž `.push` āĻŽā§āĻĨāĻĄ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ āύāĻž: āĻāĻāĻāĻŋ āĻāĻžāĻāĻĒ āĻāϰāϰ (TypeError) āĻĒā§āϰāĻĻāϰā§āĻļāĻŋāϤ āĻšāϝāĻŧāĨ¤
@@ -2971,7 +2971,7 @@ console.log(giveLydiaChocolate.prototype);
#### āĻāϤā§āϤāϰ: D
-Regular functions, such as the `giveLydiaPizza` function, have a `prototype` property, which is an object (prototype object) with a `constructor` property. Arrow functions however, such as the `giveLydiaChocolate` function, do not have this `prototype` property. `undefined` gets returned when trying to access the `prototype` property using `giveLydiaChocolate.prototype`.
+āϏāĻžāϧāĻžāϰāĻŖ āĻĢāĻžāĻāĻļāύāĻā§āϞāĻŋāϰ, āϝā§āĻŽāύ `giveLydiaPizza` āĻĢāĻžāĻāĻļāύā§āϰ, āĻāĻāĻāĻŋ `prototype` āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ āĻĨāĻžāĻā§, āϝāĻž āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻ (āĻĒā§āϰā§āĻā§āĻāĻžāĻāĻĒ āĻ
āĻŦāĻā§āĻā§āĻ) āĻāĻŦāĻ āĻāϤ⧠āĻāĻāĻāĻŋ `constructor` āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ āĻĨāĻžāĻā§āĨ¤ āϤāĻŦā§, āĻ
ā§āϝāĻžāϰ⧠āĻĢāĻžāĻāĻļāύāĻā§āϞāĻŋāϰ, āϝā§āĻŽāύ `giveLydiaChocolate` āĻĢāĻžāĻāĻļāύā§āϰ, āĻāĻ `prototype` āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ āĻĨāĻžāĻā§ āύāĻžāĨ¤ āϝāĻāύ `giveLydiaChocolate.prototype` āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ āĻ
ā§āϝāĻžāĻā§āϏā§āϏ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻž āĻšāϝāĻŧ, āϤāĻāύ `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻšāϝāĻŧāĨ¤
@@ -3001,14 +3001,15 @@ for (const [x, y] of Object.entries(person)) {
#### āĻāϤā§āϤāϰ: A
-`Object.entries(person)` returns an array of nested arrays, containing the keys and objects:
+`Object.entries(person)` āĻāĻāĻāĻŋ āύā§āϏā§āĻā§āĻĄ āĻ
ā§āϝāĻžāϰā§āϰ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§, āϝāĻžāϰ āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻāϞāĻŋāĻŽā§āύā§āĻā§ āĻĨāĻžāĻā§ āĻā§ āĻāĻŦāĻ āĻā§āϝāĻžāϞā§:
`[ [ 'name', 'Lydia' ], [ 'age', 21 ] ]`
-Using the `for-of` loop, we can iterate over each element in the array, the subarrays in this case. We can destructure the subarrays instantly in the for-of loop, using `const [x, y]`. `x` is equal to the first element in the subarray, `y` is equal to the second element in the subarray.
+`for-of` āϞā§āĻĒ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§, āĻāĻŽāϰāĻž āĻ
ā§āϝāĻžāϰā§āϰ āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ, āĻāĻ āĻā§āώā§āϤā§āϰ⧠āϏāĻžāĻŦāĻ
ā§āϝāĻžāϰā§āĻā§āϞāĻŋ, āϤ⧠āĻāĻāĻžāϰā§āĻ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻāĻŽāϰāĻž `for-of` āϞā§āĻĒā§ āϏāĻžāĻŦāĻ
ā§āϝāĻžāϰā§āĻā§āϞāĻŋāĻā§ āϏāĻžāĻĨā§ āϏāĻžāĻĨā§ āĻĄāĻŋāϏā§āĻā§āϰāĻžāĻāĻāĻžāϰ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ, `const [x, y]` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§āĨ¤ `x` āϏāĻžāĻŦāĻ
ā§āϝāĻžāϰā§āϰ āĻĒā§āϰāĻĨāĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āϏāĻŽāĻžāύ āĻšāϝāĻŧ, `y` āϏāĻžāĻŦāĻ
ā§āϝāĻžāϰā§āϰ āĻĻā§āĻŦāĻŋāϤā§āϝāĻŧ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āϏāĻŽāĻžāύ āĻšāϝāĻŧāĨ¤
-The first subarray is `[ "name", "Lydia" ]`, with `x` equal to `"name"`, and `y` equal to `"Lydia"`, which get logged.
-The second subarray is `[ "age", 21 ]`, with `x` equal to `"age"`, and `y` equal to `21`, which get logged.
+āĻĒā§āϰāĻĨāĻŽ āϏāĻžāĻŦāĻ
ā§āϝāĻžāϰ⧠`[ "name", "Lydia" ]`, āϝā§āĻāĻžāύ⧠`x` `"name"` āĻāϰ āϏāĻŽāĻžāύ āĻāĻŦāĻ `y` `"Lydia"` āĻāϰ āϏāĻŽāĻžāύ, āϝāĻž āϞāĻ āĻāϰāĻž āĻšāϝāĻŧāĨ¤
+
+āĻĻā§āĻŦāĻŋāϤā§āϝāĻŧ āϏāĻžāĻŦāĻ
ā§āϝāĻžāϰ⧠`[ "age", 21 ]`, āϝā§āĻāĻžāύ⧠`x` `"age"` āĻāϰ āϏāĻŽāĻžāύ āĻāĻŦāĻ `y` `21` āĻāϰ āϏāĻŽāĻžāύ, āϝāĻž āϞāĻ āĻāϰāĻž āĻšāϝāĻŧāĨ¤
@@ -3035,7 +3036,7 @@ getItems(["banana", "apple"], "pear", "orange")
#### āĻāϤā§āϤāϰ: D
-`...args` is a rest parameter. The rest parameter's value is an array containing all remaining arguments, **and can only be the last parameter**! In this example, the rest parameter was the second parameter. This is not possible, and will throw a syntax error.
+`...args` āĻšāϞ āĻāĻāĻāĻŋ āϰā§āϏā§āĻ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰāĨ¤ āϰā§āϏā§āĻ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰā§āϰ āĻŽāĻžāύ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āĻšāϝāĻŧ āϝāĻž āϏāĻŽāϏā§āϤ āĻ
āĻŦāĻļāĻŋāώā§āĻ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āϧāĻžāϰāĻŖ āĻāϰā§, **āĻāĻŦāĻ āĻāĻāĻŋ āĻļā§āϧā§āĻŽāĻžāϤā§āϰ āĻļā§āώ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ āĻšāϤ⧠āĻĒāĻžāϰā§**! āĻāĻ āĻāĻĻāĻžāĻšāϰāĻŖā§, āϰā§āϏā§āĻ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰāĻāĻŋ āĻĻā§āĻŦāĻŋāϤā§āϝāĻŧ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ āĻāĻŋāϞāĨ¤ āĻāĻāĻŋ āϏāĻŽā§āĻāĻŦ āύāϝāĻŧ āĻāĻŦāĻ āĻāĻāĻāĻŋ āϏāĻŋāύāĻā§āϝāĻžāĻā§āϏ āĻāϰāϰ āĻāĻāĻžāĻŦā§āĨ¤
```javascript
function getItems(fruitList, favoriteFruit, ...args) {
@@ -3045,7 +3046,7 @@ function getItems(fruitList, favoriteFruit, ...args) {
getItems(['banana', 'apple'], 'pear', 'orange');
```
-The above example works. This returns the array `[ 'banana', 'apple', 'orange', 'pear' ]`
+āĻāĻĒāϰā§āϰ āĻāĻĻāĻžāĻšāϰāĻŖāĻāĻŋ āϏāĻ āĻŋāĻāĻāĻžāĻŦā§ āĻāĻžāĻ āĻāϰā§āĨ¤ āĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠`[ 'banana', 'apple', 'orange', 'pear' ]` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠āĻĻā§āϝāĻŧāĨ¤
@@ -3076,16 +3077,16 @@ console.log(nums(1, 2));
#### āĻāϤā§āϤāϰ: B
-In JavaScript, we don't _have_ to write the semicolon (`;`) explicitly, however the JavaScript engine still adds them after statements. This is called **Automatic Semicolon Insertion**. A statement can for example be variables, or keywords like `throw`, `return`, `break`, etc.
+āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻā§, āĻāĻŽāĻžāĻĻā§āϰ āϏā§āĻĒāώā§āĻāĻāĻžāĻŦā§ āϏā§āĻŽāĻŋāĻā§āϞāύ (`;`) _āύāĻž āϞāĻŋāĻāϞ⧠āĻšāĻŦā§_, āϤāĻŦā§ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻāĻā§āĻāĻŋāύāĻ āϏā§āĻā§āĻāĻŽā§āϝāĻžāύā§āĻā§āϰ āĻĒāϰ⧠āϏā§āĻā§āϞāĻŋ āϝā§āĻ āĻāϰ⧠āĻĻā§ā§āĨ¤ āĻāĻāĻŋāĻā§ **āϏā§āĻŦāϝāĻŧāĻāĻā§āϰāĻŋāϝāĻŧ āϏā§āĻŽāĻŋāĻā§āϞāύ āϏāĻāϝā§āĻāύ** (Automatic Semicolon Insertion) āĻŦāϞāĻž āĻšāϝāĻŧāĨ¤ āĻāĻāĻāĻŋ āϏā§āĻā§āĻāĻŽā§āϝāĻžāύā§āĻ āĻšāϤ⧠āĻĒāĻžāϰ⧠āĻāĻĻāĻžāĻšāϰāĻŖāϏā§āĻŦāϰā§āĻĒ āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞāĻā§āϞāĻŋ, āĻŦāĻž āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄ āϝā§āĻŽāύ `throw`, `return`, `break`, āĻāϤā§āϝāĻžāĻĻāĻŋāĨ¤
-Here, we wrote a `return` statement, and another value `a + b` on a _new line_. However, since it's a new line, the engine doesn't know that it's actually the value that we wanted to return. Instead, it automatically added a semicolon after `return`. You could see this as:
+āĻāĻāĻžāύā§, āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ `return` āϏā§āĻā§āĻāĻŽā§āϝāĻžāύā§āĻā§āϰ āϞāĻŋāĻā§āĻāĻŋ, āĻāĻŦāĻ āĻāϰā§āĻāĻāĻŋ āĻŽāĻžāύ `a + b` āĻāĻāĻāĻŋ _āύāϤā§āύ āϞāĻžāĻāύā§_āĨ¤ āϤāĻŦā§, āϝā§āĻšā§āϤ⧠āĻāĻāĻŋ āĻāĻāĻāĻŋ āύāϤā§āύ āϞāĻžāĻāύ, āĻāĻā§āĻāĻŋāύ āĻāĻžāύ⧠āύāĻž āϝ⧠āĻāĻāĻŋ āĻāϏāϞ⧠āϏā§āĻ āĻŽāĻžāύ āϝāĻž āĻāĻŽāϰāĻž āĻĢā§āϰāϤ āĻĻāĻŋāϤ⧠āĻā§āϝāĻŧā§āĻāĻŋāϞāĻžāĻŽāĨ¤ āĻĒāϰāĻŋāĻŦāϰā§āϤā§, āĻāĻāĻŋ āϏā§āĻŦāϝāĻŧāĻāĻā§āϰāĻŋāϝāĻŧāĻāĻžāĻŦā§ `return` āĻāϰ āĻĒāϰ⧠āĻāĻāĻāĻŋ āϏā§āĻŽāĻŋāĻā§āϞāύ āϝā§āĻ āĻāϰā§āĻā§āĨ¤ āĻāĻĒāύāĻŋ āĻāϰāĻāĻŽ āĻāĻžāĻŦāϤ⧠āĻĒāĻžāϰā§āύ:
```javascript
return;
a + b;
```
-This means that `a + b` is never reached, since a function stops running after the `return` keyword. If no value gets returned, like here, the function returns `undefined`. Note that there is no automatic insertion after `if/else` statements!
+āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ āϝ⧠`a + b`-āϤ⧠āĻāĻāύāĻ āĻĒā§āĻāĻāĻžāύ⧠āĻšāϝāĻŧ āύāĻž, āĻāĻžāϰāĻŖ āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻļāύ `return` āĻā§āĻāϝāĻŧāĻžāϰā§āĻĄā§āϰ āĻĒāϰ⧠āĻāϞāĻž āĻŦāύā§āϧ āĻāϰ⧠āĻĻā§āϝāĻŧāĨ¤ āϝāĻĻāĻŋ āĻā§āύāĻ āĻŽāĻžāύ āϰāĻŋāĻāĻžāϰā§āύ āύāĻž āĻāϰāĻž āĻšāϝāĻŧ, āϝā§āĻŽāύ āĻāĻāĻžāύā§, āĻĢāĻžāĻāĻļāύ `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ āϞāĻā§āώā§āϝ āĻāϰāĻŦā§āύ āϝ⧠`if/else` āϏā§āĻā§āĻāĻŽā§āϝāĻžāύā§āĻā§āϰ āĻĒāϰ⧠āĻā§āύāĻ āϏā§āĻŦāϝāĻŧāĻāĻā§āϰāĻŋāϝāĻŧ āϏāĻāϝā§āĻāύ āύā§āĻ!
@@ -3121,7 +3122,7 @@ console.log(member.name);
#### āĻāϤā§āϤāϰ: B
-We can set classes equal to other classes/function constructors. In this case, we set `Person` equal to `AnotherPerson`. The name on this constructor is `Sarah`, so the name property on the new `Person` instance `member` is `"Sarah"`.
+āĻāĻŽāϰāĻž āĻā§āϞāĻžāϏāĻā§āϞāĻŋāĻā§ āĻ
āύā§āϝ āĻā§āϞāĻžāϏ/āĻĢāĻžāĻāĻļāύ āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰā§āϰ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž `Person`-āĻā§ `AnotherPerson` āĻāϰ āϏāĻŽāĻžāύ āĻāϰā§āĻāĻŋāĨ¤ āĻāĻ āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰā§āϰ āύāĻžāĻŽ `Sarah`, āϤāĻžāĻ āύāϤā§āύ `Person` āĻāύāϏā§āĻā§āϝāĻžāύā§āϏ `member` āĻāϰ name āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ `"Sarah"` āĻšāĻŦā§āĨ¤
@@ -3149,9 +3150,9 @@ console.log(Object.keys(info));
#### āĻāϤā§āϤāϰ: D
-A Symbol is not _enumerable_. The Object.keys method returns all _enumerable_ key properties on an object. The Symbol won't be visible, and an empty array is returned. When logging the entire object, all properties will be visible, even non-enumerable ones.
+āĻāĻāĻāĻŋ Symbol _enumerable_ āύāϝāĻŧāĨ¤ Object.keys āĻŽā§āĻĨāĻĄ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āϏāĻŽāϏā§āϤ _enumerable_ āĻā§ āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋāĻā§āϞāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ Symbol āĻĻā§āĻļā§āϝāĻŽāĻžāύ āĻšāĻŦā§ āύāĻž, āĻāĻŦāĻ āĻāĻāĻāĻŋ āĻāĻžāϞāĻŋ āĻ
ā§āϝāĻžāϰ⧠āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ āĻĒā§āϰ⧠āĻ
āĻŦāĻā§āĻā§āĻāĻāĻŋ āϞāĻ āĻāϰāϞā§, āϏāĻŽāϏā§āϤ āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ āĻĻā§āĻļā§āϝāĻŽāĻžāύ āĻšāĻŦā§, āĻāĻŽāύāĻāĻŋ non-enumerable āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋāĻā§āϞāĻŋāĻāĨ¤
-This is one of the many qualities of a symbol: besides representing an entirely unique value (which prevents accidental name collision on objects, for example when working with 2 libraries that want to add properties to the same object), you can also "hide" properties on objects this way (although not entirely. You can still access symbols using the `Object.getOwnPropertySymbols()` method).
+āĻāĻāĻŋ āĻāĻāĻāĻŋ Symbol āĻāϰ āĻ
āύā§āĻ āĻā§āĻŖāĻžāĻŦāϞā§āϰ āĻŽāϧā§āϝ⧠āĻāĻāĻāĻŋ: āϏāĻŽā§āĻĒā§āϰā§āĻŖ āĻ
āύāύā§āϝ āĻŽāĻžāύ āĻāĻĒāϏā§āĻĨāĻžāĻĒāύ āĻāϰāĻžāϰ āĻĒāĻžāĻļāĻžāĻĒāĻžāĻļāĻŋ (āϝāĻž āĻ
āĻŦāĻā§āĻā§āĻāĻā§āϞāĻŋāϤ⧠āĻāĻāϏā§āĻŽāĻŋāĻ āύāĻžāĻŽ āϏāĻāĻāϰā§āώ āĻĒā§āϰāϤāĻŋāϰā§āϧ āĻāϰā§, āĻāĻĻāĻžāĻšāϰāĻŖāϏā§āĻŦāϰā§āĻĒ āϝāĻāύ āĻĻā§āĻāĻŋ āϞāĻžāĻāĻŦā§āϰā§āϰāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§ āĻāĻāĻ āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ āϝā§āĻ āĻāϰāϤ⧠āĻāĻžāϝāĻŧ), āĻāĻĒāύāĻŋ āĻāĻ āĻāĻĒāĻžāϝāĻŧā§ āĻ
āĻŦāĻā§āĻā§āĻāĻā§āϞāĻŋāϤ⧠āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋāĻā§āϞāĻŋ "āϞā§āĻāĻžāϤā§" āĻĒāĻžāϰā§āύ (āϝāĻĻāĻŋāĻ āϏāĻŽā§āĻĒā§āϰā§āĻŖāϰā§āĻĒā§ āύāϝāĻŧāĨ¤ āĻāĻĒāύāĻŋ āĻāĻāύāĻ `Object.getOwnPropertySymbols()` āĻŽā§āĻĨāĻĄ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠Symbol āĻā§āϞāĻŋāϤ⧠āĻ
ā§āϝāĻžāĻā§āϏā§āϏ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύ)āĨ¤
@@ -3181,15 +3182,15 @@ console.log(getUser(user))
#### āĻāϤā§āϤāϰ: A
-The `getList` function receives an array as its argument. Between the parentheses of the `getList` function, we destructure this array right away. You could see this as:
+`getList` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻšāĻŋāϏāĻžāĻŦā§ āĻā§āϰāĻšāĻŖ āĻāϰā§āĨ¤ `getList` āĻĢāĻžāĻāĻļāύā§āϰ āĻŦāύā§āϧāύā§āϰ āĻŽāϧā§āϝā§, āĻāĻŽāϰāĻž āĻāĻ āĻ
ā§āϝāĻžāϰā§āĻāĻŋ āϏāĻžāĻĨā§ āϏāĻžāĻĨā§ āĻĄāĻŋāϏā§āĻā§āϰāĻžāĻāĻāĻžāϰ āĻāϰāĻŋāĨ¤ āĻāĻĒāύāĻŋ āĻāĻāĻŋ āĻāĻāĻžāĻŦā§ āĻĻā§āĻāϤ⧠āĻĒāĻžāϰā§āύ:
`[x, ...y] = [1, 2, 3, 4]`
-With the rest parameter `...y`, we put all "remaining" arguments in an array. The remaining arguments are `2`, `3` and `4` in this case. The value of `y` is an array, containing all the rest parameters. The value of `x` is equal to `1` in this case, so when we log `[x, y]`, `[1, [2, 3, 4]]` gets logged.
+āϰā§āϏā§āĻ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ `...y` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§, āĻāĻŽāϰāĻž āϏāĻŽāϏā§āϤ "āĻ
āĻŦāĻļāĻŋāώā§āĻ" āĻāϰā§āĻā§āĻŽā§āύā§āĻāĻā§āϞāĻŋāĻā§ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰā§āϤ⧠āϰāĻžāĻāĻŋāĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰ⧠āĻ
āĻŦāĻļāĻŋāώā§āĻ āĻāϰā§āĻā§āĻŽā§āύā§āĻāĻā§āϞāĻŋ āĻšāϞ `2`, `3` āĻāĻŦāĻ `4`āĨ¤ `y` āĻāϰ āĻŽāĻžāύ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰā§, āϝāĻž āϏāĻŽāϏā§āϤ āϰā§āϏā§āĻ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ āϧāĻžāϰāĻŖ āĻāϰā§āĨ¤ `x` āĻāϰ āĻŽāĻžāύ āĻāĻ āĻā§āώā§āϤā§āϰ⧠`1`, āϤāĻžāĻ āϝāĻāύ āĻāĻŽāϰāĻž `[x, y]` āϞāĻ āĻāϰāĻŋ, āϤāĻāύ `[1, [2, 3, 4]]` āϞāĻ āĻšāϝāĻŧāĨ¤
-The `getUser` function receives an object. With arrow functions, we don't _have_ to write curly brackets if we just return one value. However, if you want to instantly return an _object_ from an arrow function, you have to write it between parentheses, otherwise everything between the two braces will be interpreted as a block statement. In this case the code between the braces is not a valid JavaScript code, so a `SyntaxError` gets thrown.
+`getUser` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻ āĻā§āϰāĻšāĻŖ āĻāϰā§āĨ¤ āĻ
ā§āϝāĻžāϰ⧠āĻĢāĻžāĻāĻļāύā§āϰ āĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž āϝāĻĻāĻŋ āĻā§āĻŦāϞ āĻāĻāĻāĻŋ āĻŽāĻžāύ āĻĢā§āϰāϤ āĻĻāĻŋāϤ⧠āĻāĻžāĻ āϤāĻŦā§ āĻāĻŽāĻžāĻĻā§āϰ āĻāĻžāϰā§āϞāĻŋ āĻŦā§āϰā§āϝāĻžāĻā§āĻ āϞāĻŋāĻāϤ⧠_āĻšāĻŦā§ āύāĻž_āĨ¤ āϤāĻŦā§, āϝāĻĻāĻŋ āĻāĻĒāύāĻŋ āĻ
ā§āϝāĻžāϰ⧠āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ āϏāĻžāĻĨā§ āϏāĻžāĻĨā§ āĻāĻāĻāĻŋ _āĻ
āĻŦāĻā§āĻā§āĻ_ āĻĢā§āϰāϤ āĻĻāĻŋāϤ⧠āĻāĻžāύ, āϤāĻŦā§ āĻāĻĒāύāĻžāĻā§ āĻāĻāĻŋ āĻŦāύā§āϧāύā§āϰ āĻŽāϧā§āϝ⧠āϞāĻŋāĻāϤ⧠āĻšāĻŦā§, āĻ
āύā§āϝāĻĨāĻžāϝāĻŧ āĻĻā§āĻāĻŋ āĻŦā§āϰā§āϏā§āϰ āĻŽāϧā§āϝ⧠āĻĨāĻžāĻāĻž āϏāĻŦāĻāĻŋāĻā§ āĻāĻāĻāĻŋ āĻŦā§āϞāĻ āϏā§āĻā§āĻāĻŽā§āύā§āĻ āĻšāĻŋāϏāĻžāĻŦā§ āĻāĻŖā§āϝ āĻāϰāĻž āĻšāĻŦā§āĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰ⧠āĻŦā§āϰā§āϏā§āϰ āĻŽāϧā§āϝ⧠āĻĨāĻžāĻāĻž āĻā§āĻĄāĻāĻŋ āĻāĻāĻāĻŋ āĻŦā§āϧ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻā§āĻĄ āύāϝāĻŧ, āϤāĻžāĻ āĻāĻāĻāĻŋ `SyntaxError` āĻĒā§āϰāĻĻāϰā§āĻļāĻŋāϤ āĻšāϝāĻŧāĨ¤
-The following function would have returned an object:
+āύāĻŋāĻŽā§āύāϞāĻŋāĻāĻŋāϤ āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻ āĻĢā§āϰāϤ āĻĻāĻŋāϤ:
`const getUser = user => ({ name: user.name, age: user.age })`
@@ -3216,19 +3217,20 @@ console.log(name());
#### āĻāϤā§āϤāϰ: C
-The variable `name` holds the value of a string, which is not a function, and thus cannot be invoked.
+āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ `name` āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ āĻŽāĻžāύ āϧāĻžāϰāĻŖ āĻāϰā§, āϝāĻž āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻļāύ āύāϝāĻŧ, āĻāĻŦāĻ āϤāĻžāĻ āĻāĻāĻŋ āĻāύāĻā§āĻ (āĻāϞ) āĻāϰāĻž āϏāĻŽā§āĻāĻŦ āύāϝāĻŧāĨ¤
+
+`TypeErrors` āϤāĻāύ āĻĒā§āϰāĻĻāϰā§āĻļāĻŋāϤ āĻšāϝāĻŧ āϝāĻāύ āĻā§āύāĻ āĻŽāĻžāύ āĻĒā§āϰāϤā§āϝāĻžāĻļāĻŋāϤ āĻāĻžāĻāĻĒā§āϰ āύāĻž āĻšāϝāĻŧāĨ¤ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻāĻļāĻž āĻāϰā§āĻāĻŋāϞ āϝ⧠`name` āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻļāύ āĻšāĻŦā§ āĻāĻžāϰāĻŖ āĻāĻŽāϰāĻž āĻāĻāĻŋ āĻāύāĻā§āĻ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻāĻŋāĨ¤ āĻāĻŋāύā§āϤ⧠āĻāĻāĻŋ āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ āĻāĻŋāϞ, āϤāĻžāĻ āĻāĻāĻāĻŋ TypeError āĻĒā§āϰāĻĻāϰā§āĻļāĻŋāϤ āĻšāϝāĻŧ: name is not a function!
-TypeErrors get thrown when a value is not of the expected type. JavaScript expected `name` to be a function since we're trying to invoke it. It was a string however, so a TypeError gets thrown: name is not a function!
+`SyntaxErrors` āϤāĻāύ āĻĒā§āϰāĻĻāϰā§āĻļāĻŋāϤ āĻšāϝāĻŧ āϝāĻāύ āĻāĻĒāύāĻŋ āĻāĻŽāύ āĻāĻŋāĻā§ āϞāĻŋāĻā§āĻā§āύ āϝāĻž āĻŦā§āϧ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āύāϝāĻŧ, āĻāĻĻāĻžāĻšāϰāĻŖāϏā§āĻŦāϰā§āĻĒ āϝāĻāύ āĻāĻĒāύāĻŋ `return` āĻļāĻŦā§āĻĻāĻāĻŋāĻā§ `retrun` āĻšāĻŋāϏāĻžāĻŦā§ āϞāĻŋāĻā§āĻā§āύāĨ¤
-SyntaxErrors get thrown when you've written something that isn't valid JavaScript, for example when you've written the word `return` as `retrun`.
-ReferenceErrors get thrown when JavaScript isn't able to find a reference to a value that you're trying to access.
+`ReferenceErrors` āϤāĻāύ āĻĒā§āϰāĻĻāϰā§āĻļāĻŋāϤ āĻšāϝāĻŧ āϝāĻāύ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āϏā§āĻ āĻŽāĻžāύāĻāĻŋāϰ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻā§āĻāĻā§ āĻĒāĻžāϝāĻŧ āύāĻž āϝāĻž āĻāĻĒāύāĻŋ āĻ
ā§āϝāĻžāĻā§āϏā§āϏ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻā§āύāĨ¤
---
-###### 100. What's the value of output?
+###### 100. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻā§āϰ āĻā§āϝāĻžāϞ⧠āĻāĻŋ?
```javascript
// đ⨠This is my 100th question! â¨đ
@@ -3247,16 +3249,16 @@ You should${'' && `n't`} see a therapist after so much JavaScript lol`;
#### āĻāϤā§āϤāϰ: B
-`[]` is a truthy value. With the `&&` operator, the right-hand value will be returned if the left-hand value is a truthy value. In this case, the left-hand value `[]` is a truthy value, so `"Im'` gets returned.
+`[]` āĻāĻāĻāĻŋ truthy āĻŽāĻžāύāĨ¤ `&&` āĻ
āĻĒāĻžāϰā§āĻāϰā§āϰ āϏāĻžāĻĨā§, āĻŦāĻžāĻŽ āĻĒāĻžāĻļā§āϰ āĻŽāĻžāύ āϝāĻĻāĻŋ āĻāĻāĻāĻŋ truthy āĻŽāĻžāύ āĻšāϝāĻŧ, āϤāĻžāĻšāϞ⧠āĻĄāĻžāύ āĻĒāĻžāĻļā§āϰ āĻŽāĻžāύāĻāĻŋ āĻĢā§āϰāϤ āĻĻā§āĻāϝāĻŧāĻž āĻšāĻŦā§āĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰā§, āĻŦāĻžāĻŽ āĻĒāĻžāĻļā§āϰ āĻŽāĻžāύ `[]` āĻāĻāĻāĻŋ truthy āĻŽāĻžāύ, āϤāĻžāĻ `"I'm"` āĻĢā§āϰāϤ āĻĻā§āĻāϝāĻŧāĻž āĻšāϝāĻŧāĨ¤
-`""` is a falsy value. If the left-hand value is falsy, nothing gets returned. `n't` doesn't get returned.
+`""` āĻāĻāĻāĻŋ falsy āĻŽāĻžāύāĨ¤ āϝāĻĻāĻŋ āĻŦāĻžāĻŽ āĻĒāĻžāĻļā§āϰ āĻŽāĻžāύ falsy āĻšāϝāĻŧ, āϤāĻžāĻšāϞ⧠āĻāĻŋāĻā§āĻ āĻĢā§āϰāϤ āĻĻā§āĻāϝāĻŧāĻž āĻšāϝāĻŧ āύāĻžāĨ¤ `n't` āĻĢā§āϰāϤ āĻĻā§āĻāϝāĻŧāĻž āĻšāϝāĻŧ āύāĻžāĨ¤
---
-###### 101. What's the value of output?
+###### 101. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻā§āϰ āĻā§āϝāĻžāϞ⧠āĻāĻŋ?
```javascript
const one = false || {} || null;
@@ -3289,7 +3291,7 @@ With the `||` operator, we can return the first truthy operand. If all values ar
---
-###### 102. What's the value of output?
+###### 102. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻā§āϰ āĻā§āϝāĻžāϞ⧠āĻāĻŋ?
```javascript
const myPromise = () => Promise.resolve('I have resolved!');
@@ -3333,7 +3335,7 @@ This means that it waited for the `myPromise` to resolve with the value `I have
---
-###### 103. What's the value of output?
+###### 103. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻā§āϰ āĻā§āϝāĻžāϞ⧠āĻāĻŋ?
```javascript
const set = new Set();
From 917bb1b21952b8bae36defc263b3df2b2b6f177f Mon Sep 17 00:00:00 2001
From: iamsaief
Date: Sun, 9 Jun 2024 06:48:56 +0600
Subject: [PATCH 08/12] added translation till 112
---
bn-BD/README_bn-BD.md | 84 +++++++++++++++++++++----------------------
1 file changed, 41 insertions(+), 43 deletions(-)
diff --git a/bn-BD/README_bn-BD.md b/bn-BD/README_bn-BD.md
index 3a1c2292..fb94bcef 100644
--- a/bn-BD/README_bn-BD.md
+++ b/bn-BD/README_bn-BD.md
@@ -499,7 +499,7 @@ sum(1, '2');
#### āĻāϤā§āϤāϰ: C
-āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻāĻāĻāĻŋ **āĻĄāĻžā§āύāĻžāĻŽāĻŋāĻ āĻāĻžāĻāĻĒ āĻāĻžāώāĻžāĻ** āĻāĻŽāϰāĻž āĻā§āϰāĻŋā§ā§āĻŦāϞā§āϰ āĻāĻžāĻāĻĒ āύāĻŋāϰā§āĻĻāĻŋāώā§āĻ āĻāϰāĻŋ āύāĻžāĨ¤ āĻāĻĒāύāĻŋ āĻāĻžāύāϤ⧠āĻĒāĻžāϰā§āύ āύāĻž āĻā§āϝāĻžāϞ⧠āϏā§āĻŦā§āĻāĻā§āϰāĻŋā§āĻāĻžāĻŦā§āĻ āĻāĻ āĻāĻžāĻāĻĒ āĻĨā§āĻā§ āĻ
āύā§āϝ āĻāĻžāĻāĻĒā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻšā§ā§ āϝāĻžā§, āϝā§āĻāĻžāĻā§ āĻŦāϞāĻž āĻšā§ **āĻā§ā§āĻžāϰā§āĻļāύ (coercion)**āĨ¤ āĻāĻāĻž āĻšāϞ āĻāĻ āĻāĻžāĻāĻĒ āĻĨā§āĻā§ āĻ
āύā§āϝ āĻāĻžāĻāĻĒā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻšāĻā§āĻžāĨ¤
+āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻāĻāĻāĻŋ **āĻĄāĻžā§āύāĻžāĻŽāĻŋāĻ āĻāĻžāĻāĻĒ āĻāĻžāώāĻžāĻ** āĻāĻŽāϰāĻž āĻā§āϰāĻŋā§ā§āĻŦāϞā§āϰ āĻāĻžāĻāĻĒ āύāĻŋāϰā§āĻĻāĻŋāώā§āĻ āĻāϰāĻŋ āύāĻžāĨ¤ āĻāĻĒāύāĻŋ āĻāĻžāύāϤ⧠āĻĒāĻžāϰā§āύ āύāĻž āĻā§āϝāĻžāϞ⧠āϏā§āĻŦā§āĻāĻā§āϰāĻŋā§āĻāĻžāĻŦā§āĻ āĻāĻ āĻāĻžāĻāĻĒ āĻĨā§āĻā§ āĻ
āύā§āϝ āĻāĻžāĻāĻĒā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻšā§ā§ āϝāĻžā§, āϝā§āĻāĻžāĻā§ āĻŦāϞāĻž āĻšā§ **āĻā§ā§āĻžāϰā§āĻļāύ [coercion](<(coercion)[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#type_coercion]>)**āĨ¤ āĻāĻāĻž āĻšāϞ āĻāĻ āĻāĻžāĻāĻĒ āĻĨā§āĻā§ āĻ
āύā§āϝ āĻāĻžāĻāĻĒā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻšāĻā§āĻžāĨ¤
āĻāĻ āĻāĻĻāĻžāĻšāϰāύā§, āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻāĻ āĻĢāĻžāĻāĻļāύāĻāĻŋāĻā§ āϝā§āĻā§āϤāĻŋāϏāĻā§āĻāϤ āĻ āĻāϰ āĻāĻāĻāĻŋ āĻĢāϞāĻžāĻĢāϞ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻžāϰ āĻāύā§āϝ `1` āύāĻžāĻŽā§āĻŦāĻžāϰāĻāĻŋāĻā§ āϏā§āĻā§āϰāĻŋāĻ āĻ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§āĻā§āĨ¤ āύāĻžāĻŽā§āĻŦāĻžāϰ `1` āĻ āϏā§āĻā§āϰāĻŋāĻ `"2"` āĻāϰ āϝā§āĻā§āϰ āĻŦā§āϞāĻžā§ āύāĻžāĻŽā§āĻŦāĻžāϰāĻāĻŋāĻā§ āϏā§āĻā§āϰāĻŋāĻ āĻšāĻŋāϏā§āĻŦā§ āϧāϰāĻž āĻšā§ā§āĻā§āĨ¤ āĻāĻŽāϰāĻž āĻĻā§āĻā§ āϏā§āĻā§āϰāĻŋāĻ āĻā§ āϝā§āĻā§āϤ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ āĻāĻāĻžāĻŦā§, `"Hello" + "World"`, āϤāĻžāĻ āĻāĻāĻžāύ⧠`"1" + "2"` āĻĢāϞāĻžāĻĢāϞ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§ `"12"`āĨ¤
@@ -3278,13 +3278,13 @@ console.log(one, two, three);
#### āĻāϤā§āϤāϰ: C
-With the `||` operator, we can return the first truthy operand. If all values are falsy, the last operand gets returned.
+`||` āĻ
āĻĒāĻžāϰā§āĻāϰā§āϰ āϏāĻžāĻšāĻžāϝā§āϝā§, āĻāĻŽāϰāĻž **āĻĒā§āϰāĻĨāĻŽ āϏāϤā§āϝ āĻ
āĻĒāĻžāϰā§āύā§āĻĄāĻāĻŋ** āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻžāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āϝāĻĻāĻŋ āϏāĻŽāϏā§āϤ āĻŽāĻžāύ āĻŽāĻŋāĻĨā§āϝāĻž āĻšāϝāĻŧ, **āĻļā§āώ āĻ
āĻĒāĻžāϰā§āύā§āĻĄāĻāĻŋ** āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤
-`(false || {} || null)`: the empty object `{}` is a truthy value. This is the first (and only) truthy value, which gets returned. `one` is equal to `{}`.
+`(false || {} || null)`: āĻāĻžāϞāĻŋ āĻ
āĻŦāĻā§āĻā§āĻ `{}` āĻāĻāĻāĻŋ āϏāϤā§āϝ āĻŽāĻžāύāĨ¤ āĻāĻāĻŋ āĻĒā§āϰāĻĨāĻŽ (āĻāĻŦāĻ āĻāĻāĻŽāĻžāϤā§āϰ) āϏāϤā§āϝ āĻŽāĻžāύ, āϝāĻž āϰāĻŋāĻāĻžāϰā§āύ āĻšā§āĨ¤ `one` āϏāĻŽāĻžāύ `{}`āĨ¤
-`(null || false || "")`: all operands are falsy values. This means that the last operand, `""` gets returned. `two` is equal to `""`.
+`(null || false || "")`: āϏāĻŽāϏā§āϤ āĻ
āĻĒāĻžāϰā§āύā§āĻĄ āĻŽāĻŋāĻĨā§āϝāĻž āĻŽāĻžāύāĨ¤ āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ āĻļā§āώ āĻ
āĻĒāĻžāϰā§āύā§āĻĄ, `""` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻšāϝāĻŧāĨ¤ `two` āϏāĻŽāĻžāύ `""`āĨ¤
-`([] || 0 || "")`: the empty array`[]` is a truthy value. This is the first truthy value, which gets returned. `three` is equal to `[]`.
+`([] || 0 || "")`: āĻāĻžāϞāĻŋ āĻ
ā§āϝāĻžāϰā§`[]` āĻāĻāĻāĻŋ āϏāϤā§āϝ āĻŽāĻžāύāĨ¤ āĻāĻ āĻĒā§āϰāĻĨāĻŽ āϏāϤā§āϝ āĻŽāĻžāύ, āϝāĻž āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻšā§. `three` āϏāĻŽāĻžāύ `[]`āĨ¤
@@ -3320,15 +3320,15 @@ secondFunction();
#### āĻāϤā§āϤāϰ: D
-With a promise, we basically say _I want to execute this function, but I'll put it aside for now while it's running since this might take a while. Only when a certain value is resolved (or rejected), and when the call stack is empty, I want to use this value._
+āĻāĻāĻāĻŋ āĻĒā§āϰāĻŽāĻŋāϏā§āϰ āĻŽāĻžāϧā§āϝāĻŽā§, āĻāĻŽāϰāĻž āĻŽā§āϞāϤ āĻŦāϞāĻŋ, _āĻāĻŽāĻŋ āĻāĻ āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāĻžāϞāĻžāϤ⧠āĻāĻžāĻ, āĻāĻŋāύā§āϤ⧠āĻāĻāĻŋ āϏāĻŽā§āĻĒā§āϰā§āĻŖ āĻšāϤ⧠āϏāĻŽāϝāĻŧ āϞāĻžāĻāϤ⧠āĻĒāĻžāϰ⧠āĻŦāϞ⧠āĻāĻāύ āĻāĻāĻŋāĻā§ āĻāĻāĻĒāĻžāĻļā§ āϰā§āĻā§ āĻĻā§āĻŦāĨ¤ āϝāĻāύ āĻā§āύ āύāĻŋāϰā§āĻĻāĻŋāώā§āĻ āĻā§āϝāĻžāϞ⧠āϰāĻŋāϏāϞā§āĻ (āĻŦāĻž āϰāĻŋāĻā§āĻā§āĻ) āĻšāϝāĻŧ, āĻāĻŦāĻ āϝāĻāύ āĻāϞ āϏā§āĻā§āϝāĻžāĻ āĻāĻžāϞāĻŋ āĻĨāĻžāĻā§, āĻ āĻŋāĻ āϤāĻāύāĻ āĻāĻŽāĻŋ āĻāĻ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻāĻžāĻāĨ¤_
-We can get this value with both `.then` and the `await` keywords in an `async` function. Although we can get a promise's value with both `.then` and `await`, they work a bit differently.
+āĻāĻāĻāĻŋ `async` āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ āĻāĻ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻŽāϰāĻž `.then` āĻāĻŦāĻ `await` āĻāĻŋāĻā§āĻžāϰā§āĻĄ āĻĻā§āĻāĻŋ āĻĻāĻŋā§ā§āĻ āĻĒā§āϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āϝāĻĻāĻŋāĻ āĻāĻŽāϰāĻž `.then` āĻāĻŦāĻ `await` āĻĻā§āĻāĻžāĻŦā§āĻ āĻĒā§āϰāĻŽāĻŋāϏā§āϰ āĻā§āϝāĻžāϞ⧠āĻĒā§āϤ⧠āĻĒāĻžāϰāĻŋ, āϤāĻŦā§ āĻāϰāĻž āĻāĻāĻā§ āĻāĻŋāύā§āύāĻāĻžāĻŦā§ āĻāĻžāĻ āĻāϰā§āĨ¤
-In the `firstFunction`, we (sort of) put the myPromise function aside while it was running, but continued running the other code, which is `console.log('second')` in this case. Then, the function resolved with the string `I have resolved`, which then got logged after it saw that the callstack was empty.
+- `firstFunction` āĻ, āĻāĻŽāϰāĻž (āϝā§āύ) myPromise āĻĢāĻžāĻāĻļāύāĻāĻŋāĻā§ āĻāĻāĻĒāĻžāĻļā§ āϰā§āĻā§ āĻĻāĻŋā§ā§āĻāĻŋāϞāĻžāĻŽ āϝāĻāύ āĻāĻāĻŋ āĻāϞāĻŽāĻžāύ āĻāĻŋāϞ, āĻāĻŋāύā§āϤ⧠āĻ
āύā§āϝ āĻā§āĻĄāĻā§āϞ⧠āĻāϞāϤ⧠āĻĨāĻžāĻā§, āĻāĻ āĻā§āώā§āϤā§āϰ⧠`console.log('second')`āĨ¤ āϤāĻžāϰāĻĒāϰ āĻĢāĻžāĻāĻļāύāĻāĻŋ "I have resolved" āϏā§āĻā§āϰāĻŋāĻ āύāĻŋā§ā§ āϰāĻŋāϏāϞā§āĻ āĻšā§, āĻāĻŦāĻ āĻāĻāĻŋāĻ āĻĒāϰāĻŦāϰā§āϤāĻŋāϤ⧠āϞāĻ āĻšā§ā§āĻā§ āϝāĻāύ āϏ⧠āĻāϞ āϏā§āĻā§āϝāĻžāĻ āĻāĻžāϞāĻŋ āĻĒā§ā§ā§āĻā§āĨ¤
-With the await keyword in `secondFunction`, we literally pause the execution of an async function until the value has been resolved before moving to the next line.
+- `secondFunction` āĻ, `await` āĻāĻŋāĻā§āĻžāϰā§āĻĄā§āϰ āϏāĻžāĻšāĻžāϝā§āϝ⧠āĻāĻŽāϰāĻž āĻāĻā§āώāϰāĻŋāĻ āĻ
āϰā§āĻĨā§ āĻāĻāĻāĻŋ `async` āĻĢāĻžāĻāĻļāύā§āϰ āĻāĻžāϰā§āϝāĻā§āϰāĻŽāĻā§ āĻŦāĻŋāϰāϤāĻŋ āĻĻāĻŋā§ā§ āĻā§āϝāĻžāϞā§āĻāĻŋ āύāĻŋāĻļā§āĻāĻŋāϤ (āϰāĻŋāϏāϞā§āĻ) āύāĻž āĻšāĻā§āĻž āĻĒāϰā§āϝāύā§āϤ āĻ
āĻĒā§āĻā§āώāĻž āĻāϰāĻŋ, āϤāĻžāϰāĻĒāϰ āĻĒāϰā§āϰ āϞāĻžāĻāύ⧠āϝāĻžāĻāĨ¤
-This means that it waited for the `myPromise` to resolve with the value `I have resolved`, and only once that happened, we moved to the next line: `second` got logged.
+ āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ, āĻāĻāĻŋ `myPromise` āĻĢāĻžāĻāĻļāύāĻāĻŋāϰ `I have resolved` āϏā§āĻā§āϰāĻŋāĻ āύāĻŋā§ā§ āϰāĻŋāϏāϞā§āĻ āĻšāĻā§āĻž āĻĒāϰā§āϝāύā§āϤ āĻ
āĻĒā§āĻā§āώāĻž āĻāϰā§, āĻāĻŦāĻ āĻā§āĻŦāϞ āϤāĻž āĻāĻāĻžāϰ āĻĒāϰā§āĻ āĻāĻŽāϰāĻž āĻĒāϰā§āϰ āϞāĻžāĻāύ⧠āĻāĻŋā§ā§āĻāĻŋ: `second` āϞāĻ āĻšā§ā§āĻā§āĨ¤
@@ -3359,20 +3359,20 @@ for (let item of set) {
#### āĻāϤā§āϤāϰ: C
-The `+` operator is not only used for adding numerical values, but we can also use it to concatenate strings. Whenever the JavaScript engine sees that one or more values are not a number, it coerces the number into a string.
+`+` āĻ
āĻĒāĻžāϰā§āĻāϰāĻāĻŋ āĻļā§āϧā§āĻŽāĻžāϤā§āϰ āϏāĻāĻā§āϝāĻžāϏā§āĻāĻ āĻā§āϝāĻžāϞā§āĻ āϝā§āĻ āĻāϰāĻžāϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻž āĻšāϝāĻŧ āύāĻž, āĻāĻŽāϰāĻž āϏā§āĻā§āϰāĻŋāĻ āϏāĻāϝā§āĻā§āϤ (concatenate) āĻāϰāϤā§āĻ āĻāĻāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āϝāĻāύāĻ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻāĻā§āĻāĻŋāύ āĻĻā§āĻā§ āϝ⧠āĻāĻ āĻŦāĻž āĻāĻāĻžāϧāĻŋāĻ āĻā§āϝāĻžāϞā§āĻā§āϞ⧠āĻāĻāĻāĻŋ āϏāĻāĻā§āϝāĻž āύāϝāĻŧ, āĻāĻāĻŋ āϏāĻāĻā§āϝāĻžāĻāĻŋāĻā§ āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻā§ā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§, āĻāĻāĻžāĻā§ āĻŦāϞāĻž āĻšā§ āĻā§ā§āĻžāϰā§āĻļāύ ([coercion]([https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#type_coercion]))āĨ¤
-The first one is `1`, which is a numerical value. `1 + 2` returns the number 3.
+āĻĒā§āϰāĻĨāĻŽāĻāĻŋ āĻšāϞ `1`, āϝāĻž āĻāĻāĻāĻŋ āϏāĻāĻā§āϝāĻžāϏā§āĻāĻ āĻā§āϝāĻžāϞā§āĨ¤ `1 + 2` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠āύāĻžāĻŽā§āĻŦāĻžāϰ `3`āĨ¤
-However, the second one is a string `"Lydia"`. `"Lydia"` is a string and `2` is a number: `2` gets coerced into a string. `"Lydia"` and `"2"` get concatenated, which results in the string `"Lydia2"`.
+āĻ
āύā§āϝāĻĻāĻŋāĻā§, āĻĻā§āĻŦāĻŋāϤā§āϝāĻŧāĻāĻŋ āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ `"Lydia"`āĨ¤ `"Lydia"` āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ āĻāĻŦāĻ `2` āĻšāϞ āĻāĻāĻāĻŋ āϏāĻāĻā§āϝāĻž: āϤāĻžāĻ `2` āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻāϝāĻŧā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāĻŋāϤ āĻšā§āĨ¤ `"Lydia"` āĻāĻŦāĻ `"2"` āĻāĻāϤā§āϰāĻŋāϤ āĻšāϝāĻŧ, āϝāĻžāϰ āĻĢāϞ⧠`"Lydia2"` āϏā§āĻā§āϰāĻŋāĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤
-`{ name: "Lydia" }` is an object. Neither a number nor an object is a string, so it stringifies both. Whenever we stringify a regular object, it becomes `"[object Object]"`. `"[object Object]"` concatenated with `"2"` becomes `"[object Object]2"`.
+`{ name: "Lydia" }` āĻšāϞ āĻ
āĻŦāĻā§āĻā§āĻāĨ¤ āĻāĻāĻāĻŋ āύāĻžāĻŽā§āĻŦāĻžāϰ āĻŦāĻž āĻ
āĻŦāĻā§āĻā§āĻ āĻā§āύāĻāĻžāĻ āϏā§āĻā§āϰāĻŋāĻ āύā§, āϤāĻžāĻ āĻ āĻĻā§āĻāĻŋ āϏā§āĻā§āϰāĻŋāĻāĻĢāĻžāĻ āĻšā§āĨ¤ āϝāĻāύāĻŋ āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ āϏāĻžāϧāĻžāϰāĻŖ āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āϏā§āĻā§āϰāĻŋāĻāĻĢāĻžāĻ āĻāϰāĻŋ āĻāĻāĻž āĻšā§ā§ āϝāĻžā§ - `"[object Object]"`āĨ¤ `"[object Object]"` `"2"` āĻāϰ āϏāĻžāĻĨā§ āĻāĻāϤā§āϰāĻŋāϤ āĻšā§ā§ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`"[object Object]2"`āĨ¤
---
-###### 104. What's its value?
+###### 104. āĻāĻāĻžāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻŋ āĻšāĻŦā§?
```javascript
Promise.resolve(5);
@@ -3388,16 +3388,16 @@ Promise.resolve(5);
#### āĻāϤā§āϤāϰ: C
-We can pass any type of value we want to `Promise.resolve`, either a promise or a non-promise. The method itself returns a promise with the resolved value (``). If you pass a regular function, it'll be a resolved promise with a regular value. If you pass a promise, it'll be a resolved promise with the resolved value of that passed promise.
+`Promise.resolve` āĻ āĻāĻŽāϰāĻž āϝā§āĻā§āύ āĻāĻžāĻāĻĒā§āϰ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ, āĻāĻāĻāĻŋ āĻĒā§āϰāĻŽāĻŋāϏ āĻŦāĻž āύāύ-āĻĒā§āϰāĻŽāĻŋāϏāĨ¤ āĻŽā§āĻĨāĻĄāĻāĻŋ āύāĻŋāĻā§āĻ āϰāĻŋāϏāϞā§āĻ āĻšāĻā§āĻž āĻā§āϝāĻžāϞā§āĻāĻŋ (``) āϏāĻš āĻāĻāĻāĻŋ āĻĒā§āϰāĻŽāĻŋāϏ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ āϝāĻĻāĻŋ āĻāĻĒāύāĻŋ āĻāĻāĻāĻŋ āĻāĻāĻāĻŋ āϰā§āĻā§āϞāĻžāϰ āĻĢāĻžāĻāĻļāύ āĻĒāĻžāϏ āĻāϰā§āύ, āĻāĻāĻž āĻāĻāĻāĻŋ āϰā§āĻā§āϞāĻžāϰ āĻā§āϝāĻžāϞ⧠āϏāĻš āĻāĻāĻāĻŋ āϰāĻŋāϏāϞā§āĻ āĻĒā§āϰāĻŽāĻŋāϏ āĻšāĻŦā§āĨ¤ āϝāĻĻāĻŋ āĻĒā§āϰāĻŽāĻŋāϏ āĻĒāĻžāϏ āĻāϰā§āύ, āĻāĻāĻž āĻĒāĻžāϏ āĻāϰāĻž āĻ āĻĒā§āϰāĻŽāĻŋāϏā§āϰ āϰāĻŋāϏāϞā§āĻ āĻā§āϝāĻžāϞ⧠āϏāĻš āĻāĻāĻāĻŋ āϰāĻŋāϏāϞā§āĻ āĻĒā§āϰāĻŽāĻŋāϏ āĻšāĻŦā§āĨ¤
-In this case, we just passed the numerical value `5`. It returns a resolved promise with the value `5`.
+āĻāĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž āĻā§āĻŦāϞ āĻĒāĻžāϏ āĻāϰā§āĻāĻŋ āĻāĻāĻāĻŋ āϏāĻāĻā§āϝāĻžāϏā§āĻāĻ āĻā§āϝāĻžāϞ⧠`5`āĨ¤ āϤāĻžāĻ āĻāĻāĻž `5` āĻā§āϝāĻžāϞā§āĻāĻŋāϏāĻš āĻāĻāĻāĻŋ āϰāĻŋāϏāϞā§āĻ āĻĒā§āϰāĻŽāĻŋāϏ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĻā§āĨ¤
---
-###### 105. What's its value?
+###### 105. āĻāĻāĻžāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻŋ āĻšāĻŦā§?
```javascript
function compareMembers(person1, person2 = person) {
@@ -3423,20 +3423,18 @@ compareMembers(person);
#### āĻāϤā§āϤāϰ: B
-Objects are passed by reference. When we check objects for strict equality (`===`), we're comparing their references.
+āĻ
āĻŦāĻā§āĻā§āĻ āĻĒāĻžāϏ āĻšā§ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻĻā§āĻŦāĻžāϰāĻžāĨ¤ āϝāĻāύ āĻāĻŽāϰāĻž āĻāĻ ā§āϰ āϏāĻŽāϤāĻžāϰ (strict equality `===`) āĻāύā§āϝ āĻ
āĻŦāĻā§āĻā§āĻāĻā§āϞāĻŋ āĻĒāϰā§āĻā§āώāĻž āĻāϰāĻŋ, āϤāĻāύ āĻāĻŽāϰāĻž āĻāĻĻāϤ⧠āϤāĻžāĻĻā§āϰ āϰā§āĻĢāĻžāϰā§āύā§āϏāĻā§āϞāĻŋ āϤā§āϞāύāĻž āĻāϰāĻāĻŋāĨ¤
-We set the default value for `person2` equal to the `person` object, and passed the `person` object as the value for `person1`.
+āĻāĻŽāϰāĻž `person2`-āĻāϰ āĻāĻāĻāĻŋ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰā§āĻāĻŋ `person` āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āĻāĻŦāĻ `person1`-āĻāϰ āĻā§āϝāĻžāϞ⧠āĻšāĻŋāϏā§āĻŦā§āĻ āĻāĻāĻ āĻ
āĻŦāĻā§āĻā§āĻ `person`āĻā§ āĻĒāĻžāϏ āĻāϰā§āĻāĻŋāĨ¤ āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ āϝ⧠āĻāĻā§ āĻā§āϝāĻžāϞā§āϰ āĻāĻžāĻā§āĻ āĻŽā§āĻŽāϰāĻŋāϰ āĻāĻāĻ āϞā§āĻā§āĻļāύā§āϰ āϰā§āĻĢāĻžāϰā§āύā§āϏ āϰā§āĻā§, āĻāĻāĻāĻžāĻŦā§ āϤāĻžāϰāĻž āϏāĻŽāĻžāύ āĻšā§āĨ¤
-This means that both values have a reference to the same spot in memory, thus they are equal.
-
-The code block in the `else` statement gets run, and `They are the same!` gets logged.
+āĻĢāϞā§, `else` āϏā§āĻā§āĻāĻŽā§āϝāĻžāύā§āĻā§āϰ āĻā§āĻĄ āĻŦā§āϞāĻāĻāĻŋ āĻāĻžāϰā§āϝāĻāϰ āĻšāϝāĻŧ, āĻāĻŦāĻ `They are the same!` āϞāĻ āĻšāϝāĻŧāĨ¤
---
-###### 106. What's its value?
+###### 106. āĻāĻāĻžāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻŋ āĻšāĻŦā§?
```javascript
const colorConfig = {
@@ -3462,18 +3460,18 @@ console.log(colorConfig.colors[1]);
#### āĻāϤā§āϤāϰ: D
-In JavaScript, we have two ways to access properties on an object: bracket notation, or dot notation. In this example, we use dot notation (`colorConfig.colors`) instead of bracket notation (`colorConfig["colors"]`).
+āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻā§, āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āĻāĻŽāϰāĻž āĻĻā§āĻāĻāĻžāĻŦā§ āĻāĻā§āϏā§āϏ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĻ āĻŦā§āϰā§āϝāĻžāĻā§āĻ āύā§āĻā§āĻļāύ, āĻ
āĻĨāĻŦāĻž āĻĄāĻ āύā§āĻā§āĻļāύāĨ¤ āĻāĻ āĻāĻĻāĻžāĻšāϰāύā§, āĻāĻŽāϰāĻž āĻĄāĻ āύā§āĻā§āĻļāύ (`colorConfig.colors`) āĻŦā§āϝāĻžāĻŦāĻšāĻžāϰ āĻāϰā§āĻāĻŋ āĻŦā§āϰā§āϝāĻžāĻā§āĻ āύā§āĻā§āĻļāύā§āϰ (`colorConfig["colors"]`) āĻĒāϰāĻŋāĻŦāϰā§āϤā§āĨ¤
-With dot notation, JavaScript tries to find the property on the object with that exact name. In this example, JavaScript tries to find a property called `colors` on the `colorConfig` object. There is no property called `colors`, so this returns `undefined`. Then, we try to access the value of the first element by using `[1]`. We cannot do this on a value that's `undefined`, so it throws a `TypeError`: `Cannot read property '1' of undefined`.
+āĻĄāĻ āύā§āĻā§āĻļāύā§āϰ āĻŽāĻžāϧā§āϝāĻŽā§, āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻ
āĻŦāĻā§āĻā§āĻā§ āύāĻŋāϰā§āĻĻāĻŋāώā§āĻ āύāĻžāĻŽ āϧāϰ⧠āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āĻā§āĻāĻā§ āĻĒāĻžāĻā§āĻžāϰ āĻā§āώā§āĻāĻž āĻāϰā§āĨ¤ āĻāĻ āĻāĻĻāĻžāĻšāϰāύā§, āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ `colorConfig` āĻ
āĻŦāĻā§āĻā§āĻā§ `colors` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āĻā§āĻāĻā§ āĻĒāĻžāĻā§āĻžāϰ āĻā§āώā§āĻāĻž āĻāϰā§āĻā§āĨ¤ āĻāĻāĻžāύ⧠`colors` āύāĻžāĻŽā§ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻā§āĻāĻā§ āύāĻž āĻĒāĻžāĻā§āĻžā§ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§ `undefined`āĨ¤ āĻāϰāĻĒāϰ āĻāĻŽāϰāĻž `[1]` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠⧧āĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻāĻā§ āĻāĻā§āϏā§āϏ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻāĻŋāĨ¤ āĻāĻŋāύā§āϤ⧠āĻāĻŽāϰāĻž āĻāĻāĻž āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ āύāĻž āϝāĻžāϰ āĻā§āϝāĻžāϞ⧠`undefined`, āϤāĻžāĻ āĻāĻāĻŋ āĻāĻžāĻāĻĒ āĻāϰāϰ āĻāĻāĻžāĻŦā§ - `TypeError`: `Cannot read property '1' of undefined`āĨ¤
-JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. If we would've used `colorConfig[colors[1]]`, it would have returned the value of the `red` property on the `colorConfig` object.
+āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āϏā§āĻā§āĻāĻŽā§āϝāĻžāύā§āĻāĻā§āϞā§āĻā§ āĻāĻžāώāĻžāύā§āϤāϰ āĻāϰ⧠(āĻŽā§āĻļāĻŋāύā§āϰ āĻāĻžāώāĻžā§)āĨ¤ āϝāĻāύ āĻŦā§āϰā§āϝāĻžāĻā§āĻ āύā§āĻā§āĻļāύ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšā§, āĻāĻāĻž āĻļā§āϰā§āϰ āĻŦā§āϰā§āϝāĻžāĻā§āĻ `[` āĻĒā§āϞ⧠āϤāĻžāϰ āĻļā§āώ āĻŦā§āϰā§āϝāĻžāĻā§āĻ āĻĒāϰā§āϝāύā§āϤ `]` āϝā§āϤ⧠āĻĨāĻžāĻā§āĨ¤ āϤāĻžāϰāĻĒāϰāĻ āĻā§āĻŦāϞ āĻāĻāĻžāϰ āĻŽāĻžāύ āύāĻŋāϰā§āĻŖā§ āĻāϰāĻž āĻšāĻŦā§āĨ¤ āĻāĻŽāϰāĻž āϝāĻĻāĻŋ `colorConfig[colors[1]]` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤāĻžāĻŽ, āĻāĻāĻž `colorConfig` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `red` āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāϤāĨ¤
---
-###### 107. What's its value?
+###### 107. āĻāĻāĻžāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻŋ āĻšāĻŦā§?
```javascript
console.log('â¤ī¸' === 'â¤ī¸');
@@ -3487,14 +3485,14 @@ console.log('â¤ī¸' === 'â¤ī¸');
#### āĻāϤā§āϤāϰ: A
-Under the hood, emojis are unicodes. The unicodes for the heart emoji is `"U+2764 U+FE0F"`. These are always the same for the same emojis, so we're comparing two equal strings to each other, which returns true.
+āĻā§āϤāϰ⧠āĻā§āϤāϰā§, āĻāĻŽā§āĻāĻŋāĻā§āϞāĻŋ āĻšāϞ āĻāĻāύāĻŋāĻā§āĻĄā§ˇ āĻšāĻžāϰā§āĻ āĻāĻŽā§āĻāĻŋāϰ āĻāĻāύāĻŋāĻā§āĻĄ āĻšāϞ `"U+2764 U+FE0F"`āĨ¤ āĻāĻ āĻā§āϝāĻžāϞā§āĻā§āϞ⧠āĻāĻāĻ āĻāĻŽā§āĻāĻŋāĻā§āϞāĻŋāϰ āĻāύā§āϝ āϏāĻŦāϏāĻŽāϝāĻŧ āĻāĻāĻ, āϤāĻžāĻ āĻāĻŽāϰāĻž āĻĻā§āĻāĻŋ āϏā§āĻā§āϰāĻŋāĻāĻā§ āĻāĻā§ āĻ
āĻĒāϰā§āϰ āϏāĻŽāĻžāύ āĻāĻŋāύāĻž āϤā§āϞāύāĻž āĻāϰāĻāĻŋ, āϝāĻž āϏāϤā§āϝ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤
---
-###### 108. Which of these methods modifies the original array?
+###### 108. āĻāĻ āĻŽā§āĻĨāĻĄāĻā§āϞāĻŋāϰ āĻŽāϧā§āϝ⧠āĻā§āύāĻāĻŋ āĻŽā§āϞ āĻ
ā§āϝāĻžāϰ⧠āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§?
```javascript
const emojis = ['â¨', 'đĨ', 'đ'];
@@ -3517,9 +3515,9 @@ emojis.splice(1, 2, 'â¨');
#### āĻāϤā§āϤāϰ: D
-With `splice` method, we modify the original array by deleting, replacing or adding elements. In this case, we removed 2 items from index 1 (we removed `'đĨ'` and `'đ'`) and added the ⨠emoji instead.
+`splice` āĻŽā§āĻĨāĻĄā§āϰ āϏāĻžāĻšāĻžāϝā§āϝā§, āĻāĻŽāϰāĻž āĻŽā§āϞ āĻ
ā§āϝāĻžāϰ⧠āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāĻŋ āϤāĻžāϰ āĻāϞāĻŋāĻŽā§āύā§āĻāĻā§āϞāĻŋ āĻŦāĻžāĻĻ, āĻĒā§āϰāϤāĻŋāϏā§āĻĨāĻžāĻĒāύ āĻŦāĻž āϝā§āĻ āĻāϰāĻžāϰ āĻŽāĻžāϧā§āϝāĻŽā§āĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž āĻāύāĻĄā§āĻā§āϏ 1 āĻĨā§āĻā§ 2āĻāĻŋ āĻāϞāĻŋāĻŽā§āύā§āĻāĻā§ āϏāϰāĻŋāϝāĻŧā§ (āĻāĻŽāϰāĻž `'đĨ'` āĻāĻŦāĻ `'đ'` āϏāϰāĻŋāϝāĻŧā§ āĻĻāĻŋāϝāĻŧā§āĻāĻŋ) āύāϤā§āύ ⨠āĻāĻŽā§āĻāĻŋ āϝā§āĻ āĻāϰā§āĻāĻŋāĨ¤
-`map`, `filter` and `slice` return a new array, `find` returns an element, and `reduce` returns a reduced value.
+`map`, `filter` āĻāĻŦāĻ `slice` āĻāĻāĻāĻŋ āύāϤā§āύ āĻ
ā§āϝāĻžāϰ⧠āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§, `find` āĻāĻāĻāĻŋ āĻāϞāĻŋāĻŽā§āύā§āĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠āĻāĻŦāĻ `reduce` āĻāĻāĻāĻŋ āĻšā§āϰāĻžāϏāĻā§āϤ/āĻāĻāϤā§āϰāĻŋāϤ āĻā§āϝāĻžāϞ⧠āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤
@@ -3547,18 +3545,18 @@ console.log(food);
#### āĻāϤā§āϤāϰ: A
-We set the value of the `favoriteFood` property on the `info` object equal to the string with the pizza emoji, `'đ'`. A string is a primitive data type. In JavaScript, primitive data types don't interact by reference.
+āĻāĻŽāϰāĻž `info` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `favoriteFood` āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰā§āĻāĻŋ āĻĒāĻŋā§āĻāĻž āĻāĻŽā§āĻāĻŋāϰ āϏā§āĻā§āϰāĻŋāĻ `'đ'`āĻā§āĨ¤ āϏā§āĻā§āϰāĻŋāĻ āĻšāĻā§āĻā§ āĻāĻāĻāĻŋ āĻĒā§āϰāĻŋāĻŽāĻŋāĻāĻŋāĻ āĻĄā§āĻāĻž āĻāĻžāĻāĻĒāĨ¤ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻā§, āĻĒā§āϰāĻŋāĻŽāĻŋāĻāĻŋāĻ āĻĄā§āĻāĻž āĻāĻžāĻāĻĒāĻā§āϞ⧠āĻāύā§āĻāĻžāϰāĻ
ā§āϝāĻžāĻā§āĻ āĻāϰ⧠āĻā§āϝāĻžāϞ⧠āĻĻā§āĻŦāĻžāϰāĻž āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻĻā§āĻŦāĻžāϰāĻž āύā§āĨ¤
-In JavaScript, primitive data types (everything that's not an object) interact by _value_. In this case, we set the value of the `favoriteFood` property on the `info` object equal to the value of the first element in the `food` array, the string with the pizza emoji in this case (`'đ'`). A string is a primitive data type, and interact by value (see my [blogpost](https://www.theavocoder.com/complete-javascript/2018/12/21/by-value-vs-by-reference) if you're interested in learning more)
+āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻā§, āĻĒā§āϰāĻŋāĻŽāĻŋāĻāĻŋāĻ āĻĄā§āĻāĻž āĻāĻžāĻāĻĒ (āĻ
āĻŦāĻā§āĻā§āĻ āĻāĻžā§āĻž āϏāĻŦāĻāĻŋāĻā§āĻ) āϤāĻžāĻĻā§āϰ _value_ āĻĻā§āĻŦāĻžāϰāĻž āĻāύā§āĻāĻžāϰāĻ
ā§āϝāĻžāĻā§āĻ āĻāϰā§āĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž `info` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `favoriteFood` āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰā§āĻāĻŋ `food` āĻ
ā§āϝāĻžāϰā§āϰ āĻĒā§āϰāĻĨāĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āĻā§āϝāĻžāϞā§, āĻāĻ āĻā§āώā§āϤā§āϰ⧠āĻĒāĻŋā§āĻāĻž āĻāĻŽā§āĻāĻŋāϰ āϏā§āĻā§āϰāĻŋāĻ (`'đ'` )āĨ¤
-Then, we change the value of the `favoriteFood` property on the `info` object. The `food` array hasn't changed, since the value of `favoriteFood` was merely a _copy_ of the value of the first element in the array, and doesn't have a reference to the same spot in memory as the element on `food[0]`. When we log food, it's still the original array, `['đ', 'đĢ', 'đĨ', 'đ']`.
+āϤāĻžāϰāĻĒāϰ, āĻāĻŽāϰāĻž `info` āĻ
āĻŦāĻā§āĻā§āĻā§ `favoriteFood` āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāĻŋāĨ¤ `food` āĻ
ā§āϝāĻžāϰ⧠āĻĒāϰāĻŋāĻŦāϰā§āϤāĻŋāϤ āĻšāϝāĻŧāύāĻŋ, āϝā§āĻšā§āϤ⧠`favoriteFood`-āĻāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻā§āĻŦāϞ āĻ
ā§āϝāĻžāϰā§āϰ āĻĒā§āϰāĻĨāĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āĻā§āϝāĻžāϞā§āϰ āĻāĻāĻāĻŋ _copy_ āĻāĻŋāϞ, āĻāĻŦāĻ āĻāĻāĻ āĻŽā§āĻŽāϰāĻŋ āϞā§āĻā§āĻļāύā§āϰ `food[0]` āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āĻŽāϤ āĻā§āύ āϰā§āĻĢāĻžāϰā§āύā§āϏ āύā§āĨ¤ āϝāĻāύ food āϞāĻ āĻāϰāĻž āĻšā§, āĻāĻāĻž āĻāĻāύ⧠āĻ
āϰāĻŋāĻāĻŋāύāĻžāϞ āĻ
ā§āϝāĻžāϰā§āĻ āĻāĻā§, `['đ', 'đĢ', 'đĨ', 'đ']`āĨ¤
---
-###### 110. What does this method do?
+###### 110. āĻāĻ āĻŽā§āĻĨāĻĄāĻāĻŋ āĻāĻŋ āĻāϰā§?
```javascript
JSON.parse();
@@ -3574,7 +3572,7 @@ JSON.parse();
#### āĻāϤā§āϤāϰ: A
-With the `JSON.parse()` method, we can parse JSON string to a JavaScript value.
+`JSON.parse()` āĻŽā§āĻĨāĻĄ āĻŦā§āϝāĻžāĻŦāĻšāĻžāϰ āĻāϰā§, āĻāĻŽāĻžāϰāĻž JSON āϏā§āĻā§āϰāĻŋāĻāĻā§ āĻāĻāĻāĻŋ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻā§āϝāĻžāϞā§āϤ⧠āĻĒāĻžāϰā§āϏ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤
```javascript
// Stringifying a number into valid JSON, then parsing the JSON string to a JavaScript value:
@@ -3585,9 +3583,9 @@ JSON.parse(jsonNumber); // 4
const jsonArray = JSON.stringify([1, 2, 3]); // '[1, 2, 3]'
JSON.parse(jsonArray); // [1, 2, 3]
-// Stringifying an object into valid JSON, then parsing the JSON string to a JavaScript value:
-const jsonArray = JSON.stringify({ name: 'Lydia' }); // '{"name":"Lydia"}'
-JSON.parse(jsonArray); // { name: 'Lydia' }
+// Stringifying an object into valid JSON, then parsing the JSON string to a JavaScript value:
+const jsonObject = JSON.stringify({ name: 'Lydia' }); // '{"name":"Lydia"}'
+JSON.parse(jsonObject); // { name: 'Lydia' }
```
@@ -3618,11 +3616,11 @@ getName();
#### āĻāϤā§āϤāϰ: D
-Each function has its own _execution context_ (or _scope_). The `getName` function first looks within its own context (scope) to see if it contains the variable `name` we're trying to access. In this case, the `getName` function contains its own `name` variable: we declare the variable `name` with the `let` keyword, and with the value of `'Sarah'`.
+āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻĢāĻžāĻāĻļāύā§āϰ āύāĻŋāĻāϏā§āĻŦ _execution context_ (āĻŦāĻž _scope_) āĻāĻā§āĨ¤ `getName` āĻĢāĻžāĻāĻļāύāĻāĻŋāϤ⧠āϝ⧠āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻā§ āĻāĻā§āϏā§āϏ āĻāϰāĻž āĻšāĻā§āĻā§ āϝā§āĻŽāύ, `name` āϤāĻžāĻā§ āĻĒā§āϰāĻĨāĻŽā§ āϤāĻžāϰ āύāĻŋāĻāϏā§āĻŦ _context_ (āĻŦāĻž _scope_)-āĻ āĻā§āĻāĻā§ āĻĻā§āĻāĻā§āĨ¤ āĻāĻā§āώā§āϤā§āϰā§, `getName` āĻĢāĻžāĻāĻļāύ⧠āϤāĻžāϰ āύāĻŋāĻāϏā§āĻŦ `name` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞ āĻāĻā§āĻ āĻāĻŽāϰāĻž `name` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻā§ āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰā§āĻāĻŋ `let` āĻāĻŋāĻā§āĻžāϰā§āĻĄ āĻĻāĻŋā§ā§ āĻāĻŦāĻ āĻāύāĻŋāĻļāĻŋā§āĻžāϞāĻžāĻāĻ āĻāϰā§āĻāĻŋ āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ - `'Sarah'`āĨ¤
-Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don't get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`.
+`let` āĻāĻŋāĻā§āĻžāϰā§āĻĄ (āĻāĻŦāĻ `const`) āĻĻāĻŋā§ā§ āĻā§āϰāĻŋā§ā§āĻŦāϞ āύāĻŋāϞ⧠āϏā§āĻāĻžāĻ **āĻšāĻāϏā§āĻā§āĻĄ āĻšā§** āϤāĻŦā§ `var` āĻāϰ āĻŽāϤ **āĻāύāĻŋāĻļāĻŋā§āĻžāϞāĻžāĻāĻ āĻšā§ āύāĻž**āĨ¤ āϝ⧠āϞāĻžāĻāύ⧠āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ (āĻāύāĻŋāĻļāĻŋā§āĻžāϞāĻžāĻāĻ) āĻāϰāĻž āĻšā§ā§āĻā§ āϤāĻžāϰ āĻāĻā§ āϤāĻžāĻĻā§āϰāĻā§ āĻāĻā§āϏā§āϏ (āϰāĻŋāĻĄ/āϰāĻžāĻāĻ) āĻāϰāĻž āϝāĻžā§ āύāĻžāĨ¤ āĻāĻāĻžāĻā§ **"āĻā§āĻŽā§āĻĒā§āϰāĻžāϞ āĻĄā§āĻĄ āĻā§āύ"** āĻŦāϞāĻž āĻšā§āĨ¤ āϝāĻāύ āĻā§āϰāĻŋā§ā§āĻŦāϞāĻā§ āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰāĻžāϰ āĻāĻā§āĻ āϤāĻžāĻā§ āĻāĻā§āϏā§āϏ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻž āĻšā§ āϤāĻāύ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ `ReferenceError` āĻā§āĻāĻā§ā§ āĻĻā§ā§āĨ¤
-If we wouldn't have declared the `name` variable within the `getName` function, the javascript engine would've looked down the _scope chain_. The outer scope has a variable called `name` with the value of `Lydia`. In that case, it would've logged `Lydia`.
+āϝāĻĻāĻŋ `name` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻāĻŋāĻā§ āĻāĻŽāϰāĻž `getName` āĻĢāĻžāĻāĻļāύ⧠āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āύāĻž āĻāϰāϤāĻžāĻŽ, āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻāĻā§āĻāĻŋāύ āϤāĻžāĻā§ _scope chain_ āĻāϰ āĻāĻŋāϤāϰ āĻā§āĻāĻā§ āĻĻā§āĻāϤāĨ¤ āĻŦāĻžāĻāϰā§āϰ āϏā§āĻā§āĻĒā§āĻ āĻāĻāĻāĻŋ `name` āĻā§āϝāĻžāϰāĻŋā§āĻžāĻŦāϞ āĻāĻā§ āϝāĻžāϰ āĻā§āϝāĻžāϞ⧠āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ - `Lydia`āĨ¤ āĻāĻā§āώā§āϤā§āϰā§, āĻāĻāĻž āϞāĻ āĻāϰāϤ `Lydia`āĨ¤
```javascript
let name = 'Lydia';
From b1d37523a1bd7156c256f5f3a7de5440004a193a Mon Sep 17 00:00:00 2001
From: iamsaief
Date: Thu, 13 Jun 2024 13:46:35 +0600
Subject: [PATCH 09/12] added translation till 122
---
bn-BD/README_bn-BD.md | 62 ++++++++++++++++++++++---------------------
1 file changed, 32 insertions(+), 30 deletions(-)
diff --git a/bn-BD/README_bn-BD.md b/bn-BD/README_bn-BD.md
index fb94bcef..5284585b 100644
--- a/bn-BD/README_bn-BD.md
+++ b/bn-BD/README_bn-BD.md
@@ -3665,16 +3665,17 @@ console.log(two.next().value);
#### āĻāϤā§āϤāϰ: C
-With the `yield` keyword, we `yield` values in a generator function. With the `yield*` keyword, we can yield values from another generator function, or iterable object (for example an array).
+`yield` āĻāĻŋāĻā§āĻžāϰā§āĻĄ āĻĻāĻŋā§ā§, āĻāĻŽāϰāĻž āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ āĻā§āϝāĻžāϞā§āĻā§āϞ⧠`yield` āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ `yield*` āĻāĻŋāĻā§āĻžāϰā§āĻĄ āĻĻāĻŋā§ā§, āĻāĻŽāϰāĻž āĻ
āύā§āϝ āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ āĻĨā§āĻā§ āĻā§āϝāĻžāϞā§āĻā§āϞā§, āĻŦāĻž āĻāĻāĻžāϰā§āĻŦāϞ āĻ
āĻŦāĻā§āĻā§āĻ (āϝā§āĻŽāύ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰā§) āĻĨā§āĻā§ āĻā§āϝāĻžāϞā§āĻā§āϞ⧠`yield` āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤
-In `generatorOne`, we yield the entire array `['a', 'b', 'c']` using the `yield` keyword. The value of `value` property on the object returned by the `next` method on `one` (`one.next().value`) is equal to the entire array `['a', 'b', 'c']`.
+`generatorOne` āĻ, āĻāĻŽāϰāĻž `yield` āĻāĻŋāĻā§āĻžāϰā§āĻĄ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āϏāĻŽā§āĻĒā§āϰā§āύ āĻ
ā§āϝāĻžāϰ⧠`['a', 'b', 'c']` -āĻā§ `yield` āĻāϰāĻāĻŋāĨ¤
+`one` āĻāϰ āĻā§āώā§āϤā§āϰā§, (`one.next().value`) āĻāϰ `next` āĻŽā§āĻĨāĻĄā§āϰ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻ
āĻŦāĻā§āĻā§āĻā§ `value` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āĻšāϞ⧠āϏāĻŽā§āĻĒā§āϰā§āύ āĻ
ā§āϝāĻžāϰā§āĻāĻŋ- `['a', 'b', 'c']`āĨ¤
```javascript
console.log(one.next().value); // ['a', 'b', 'c']
console.log(one.next().value); // undefined
```
-In `generatorTwo`, we use the `yield*` keyword. This means that the first yielded value of `two`, is equal to the first yielded value in the iterator. The iterator is the array `['a', 'b', 'c']`. The first yielded value is `a`, so the first time we call `two.next().value`, `a` is returned.
+`generatorTwo` āĻ, āĻāĻŽāϰāĻž `yield*` āĻāĻŋāĻā§āĻžāϰā§āĻĄ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§āĻāĻŋāĨ¤ āĻāϰ āĻŽāĻžāύ⧠āĻšāϞā§, `two` āĻ āĻĒā§āϰāĻĨāĻŽ yield āĻšāĻā§āĻž āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āĻšāĻā§āĻā§ āĻāĻāĻžāϰā§āĻāϰā§āϰ (`['a', 'b', 'c']`) āĻĒā§āϰāĻĨāĻŽ yield āĻšāĻā§āĻž āĻā§āϝāĻžāϞā§āĨ¤ āĻĒā§āϰāĻĨāĻŽ yield āĻšāĻā§āĻž āĻā§āϝāĻžāϞ⧠āĻšāϞ⧠`a`, āϤāĻžāĻ āĻĒā§āϰāĻĨāĻŽāĻŦāĻžāϰ `two.next().value` āĻāϞ āĻāϰāϞ⧠āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`a`āĨ¤
```javascript
console.log(two.next().value); // 'a'
@@ -3704,14 +3705,14 @@ console.log(`${((x) => x)('I love')} to program`);
#### āĻāϤā§āϤāϰ: A
-Expressions within template literals are evaluated first. This means that the string will contain the returned value of the expression, the immediately invoked function `(x => x)('I love')` in this case. We pass the value `'I love'` as an argument to the `x => x` arrow function. `x` is equal to `'I love'`, which gets returned. This results in `I love to program`.
+āĻā§āĻŽāĻĒā§āϞā§āĻ āϞāĻŋāĻāĻžāϰā§āϞā§āϰ āĻŽāϧā§āϝ⧠āĻĨāĻžāĻāĻž āĻāĻā§āϏāĻĒā§āϰā§āĻļāύā§āϰ āĻŽāĻžāύ āύāĻŋāϰā§āĻŖā§ āĻšā§ āϏāϰā§āĻŦāĻĒā§āϰāĻĨāĻŽā§āĨ¤ āĻāϰ āĻŽāĻžāύ⧠āĻšāϞā§, āĻāĻā§āϏāĻĒā§āϰā§āĻļāύ āĻĨā§āĻā§ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻā§āϝāĻžāϞā§āĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ āĻāϰ āĻŽāϧā§āϝ⧠āĻĨāĻžāĻāĻŦā§, āĻāĻā§āώā§āϤā§āϰā§, `(x => x)('I love')` āĻāĻŽāĻŋāĻĄāĻŋā§ā§āĻāϞāĻŋ āĻāύāĻā§āĻāĻĄ āĻĢāĻžāĻāĻļāύāĨ¤ āĻāĻŽāϰāĻž `x => x` āĻ
ā§āϝāĻžāϰ⧠āĻĢāĻžāĻāĻļāύā§āϰ āĻāĻāĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻšāĻŋāϏā§āĻŦā§ `'I love'` āϏā§āĻā§āϰāĻŋāĻāĻāĻŋ āĻĒāĻžāϏ āĻāϰāĻāĻŋāĨ¤ āϤāĻžāĻ `x` āϏāĻŽāĻžāύ āĻšā§ `'I love'`, āϝā§āĻāĻž āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻšā§āĨ¤ āϤāĻžāĻ āĻĢāϞāĻžāĻĢāϞ āĻšāĻŋāϏā§āĻŦā§ `I love to program` āĻĒāĻžāĻā§āĻž āϝāĻžāĻā§āĻā§āĨ¤
---
-###### 114. What will happen?
+###### 114. āĻāĻāĻžāύ⧠āĻāĻŋ āĻāĻāĻŦā§?
```javascript
let config = {
@@ -3733,18 +3734,16 @@ config = null;
#### āĻāϤā§āϤāϰ: C
-Normally when we set objects equal to `null`, those objects get _garbage collected_ as there is no reference anymore to that object. However, since the callback function within `setInterval` is an arrow function (thus bound to the `config` object), the callback function still holds a reference to the `config` object.
-As long as there is a reference, the object won't get garbage collected.
-Since this is an interval, setting `config` to `null` or `delete`-ing `config.alert` won't garbage-collect the interval, so the interval will still be called.
-It should be cleared with `clearInterval(config.alert)` to remove it from memory.
-Since it was not cleared, the `setInterval` callback function will still get invoked every 1000ms (1s).
+āϏāϧāĻžāϰāύāϤ āϝāĻāύ āĻāĻŽāϰāĻž āĻ
āĻŦāĻā§āĻā§āĻ āϏāĻŽāĻžāύ `null` āϏā§āĻ āĻāϰāĻŋ, āϏā§āĻ āĻ
āĻŦāĻā§āĻā§āĻāĻā§āϞ⧠_āĻāĻžāϰāĻŦā§āĻ āĻāĻžāϞā§āĻā§āĻā§āĻĄ_ āĻšā§ā§ āϝāĻžā§ āϝā§āĻšā§āϤ⧠āĻ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻāϰ āĻā§āύ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻĨāĻžāĻā§ āύāĻžāĨ¤ āĻ
āύā§āϝāĻĻāĻŋāĻā§, āϝā§āĻšā§āϤ⧠`setInterval` āĻāϰ āĻāϞāĻŦā§āϝāĻžāĻ āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āĻĢāĻžāĻāĻļāύ (āĻāĻāύā§āϝ `config` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻā§āϤāϰ āĻāĻŦāĻĻā§āϧ āĻĨāĻžāĻāĻā§), āĻāϞāĻŦā§āϝāĻžāĻ āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāĻāύ⧠`config` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āϰā§āĻĢāĻžāϰā§āύā§āϏ āϧāϰ⧠āϰā§āĻā§āĻā§āĨ¤
+
+āϝāϤāĻā§āώāĻŖ āĻĒāϰā§āϝāύā§āϤ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻĨāĻžāĻāĻā§, āĻ
āĻŦāĻā§āĻā§āĻāĻāĻŋ _āĻāĻžāϰāĻŦā§āĻ āĻāĻžāϞā§āĻā§āĻā§āĻĄ_ āĻšāĻŦā§ āύāĻžāĨ¤ āϝā§āĻšā§āϤ⧠āĻāĻāĻŋ āĻāύā§āĻāĻžāϰāĻāĻžāϞ (āĻāĻžāĻāĻŽāĻžāϰ), `config` āĻ
āĻŦāĻā§āĻā§āĻāĻā§ `null` āϏā§āĻ āĻāϰāĻž āĻŦāĻž `delete` āĻāϰāϞā§āĻ āĻāύā§āĻāĻžāϰāĻāĻžāϞ _āĻāĻžāϰāĻŦā§āĻ āĻāĻžāϞā§āĻā§āĻā§āĻĄ_ āĻšāĻŦā§ āύāĻž, āϤāĻžāĻ āĻāύā§āĻāĻžāϰāĻāĻžāϞāĻāĻŋ āĻāĻāύ⧠āĻāϞ āĻšāĻŦā§āĨ¤ āĻāĻāĻžāĻā§ āĻŽā§āĻŽāϰāĻŋ āĻĨā§āĻā§ āĻŽā§āĻā§ āĻĢā§āϞāĻžāϰ āĻāύā§āϝ āĻāĻā§ āĻā§āϞāĻŋā§āĻžāϰ āĻāϰāĻž āĻāĻāĻŋā§ `clearInterval(config.alert)` āĻĻāĻŋā§ā§āĨ¤ āϝā§āĻšā§āϤ⧠āĻāĻāĻŋ āĻā§āϞāĻŋā§āĻžāϰ āĻšā§āύāĻŋ, `setInterval` āĻāϰ āĻāϞāĻŦā§āϝāĻžāĻ āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāĻāύ⧠āĻāϞ āĻšāϤ⧠āĻĨāĻžāĻāĻŦā§ āĻĒā§āϰāϤāĻŋ ā§§ā§Ļā§Ļā§Ļ āĻŽāĻŋāϞāĻŋāϏā§āĻā§āύā§āĻĄ (ā§§ āϏā§āĻā§āύā§āĻĄ) āĻĒāϰāĻĒāϰāĨ¤
---
-###### 115. Which method(s) will return the value `'Hello world!'`?
+###### 115. āĻā§āύ āĻŽā§āĻĨāĻĄ(āĻā§āϞā§) `'Hello world!'` āĻā§āϝāĻžāϞā§āĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻŦā§?
```javascript
const myMap = new Map();
@@ -3770,12 +3769,12 @@ myMap.get(() => 'greeting');
#### āĻāϤā§āϤāϰ: B
-When adding a key/value pair using the `set` method, the key will be the value of the first argument passed to the `set` function, and the value will be the second argument passed to the `set` function. The key is the _function_ `() => 'greeting'` in this case, and the value `'Hello world'`. `myMap` is now `{ () => 'greeting' => 'Hello world!' }`.
+āϝāĻāύ `set` āĻŽā§āĻĨāĻĄ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻāĻŋ/āĻā§āϝāĻžāϞ⧠āĻā§ā§ āϝā§āĻā§āϤ āĻāϰāĻž āĻšā§, `set` āĻŽā§āĻĨāĻĄā§ āĻĒāĻžāϏ āĻāϰāĻž āĻĒā§āϰāĻĨāĻŽ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻšāĻŦā§ _āĻāĻŋ_ āĻāĻŦāĻ āĻĻā§āĻŦāĻŋāϤā§ā§āĻāĻŋ āĻšāĻŦā§ _āĻā§āϝāĻžāϞā§_āĨ¤ āĻāĻā§āώā§āϤā§āϰ⧠_āĻāĻŋ_ āĻšāϞ⧠_function_ `() => 'greeting'` āĻāĻŦāĻ _āĻā§āϝāĻžāϞā§_ āĻšāϞ⧠`'Hello world'`āĨ¤ āĻĢāϞ⧠`myMap` āĻāĻāύ āĻšā§ āĻāĻŽāύ - `{ () => 'greeting' => 'Hello world!' }`
-1 is wrong, since the key is not `'greeting'` but `() => 'greeting'`.
-3 is wrong, since we're creating a new function by passing it as a parameter to the `get` method. Object interacts by _reference_. Functions are objects, which is why two functions are never strictly equal, even if they are identical: they have a reference to a different spot in memory.
+**1**, `myMap.get('greeting')`āĻāĻŋ āĻā§āϞ, āϝā§āĻšāϤ⧠āĻāĻŋ `'greeting'` āύ⧠āĻŦāϰāĻ `() => 'greeting'`āĨ¤
+
+**3**, `myMap.get(() => 'greeting')` āĻāĻŋāĻ āĻā§āϞ, āϝā§āĻšā§āϤ⧠āĻāĻŽāϰāĻž āύāϤā§āύ āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻļāύ āϤā§āϰāĻŋ āĻāϰāĻāĻŋ āĻāĻāĻžāĻā§ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ āĻšāĻŋāϏā§āĻŦā§ `set` āĻŽā§āĻĨāĻĄā§ āĻĒāĻžāϏ āĻāϰāĻžāϰ āĻŽāĻžāϧā§āϝāĻŽā§āĨ¤ āĻ
āĻŦāĻā§āĻā§āĻ _reference_ āĻĻā§āĻŦāĻžāϰāĻž āĻāύā§āĻāĻžāϰāĻ
ā§āϝāĻžāĻā§āĻ āĻāϰā§āĨ¤ āĻĢāĻžāĻāĻļāύ āĻšāϞ āĻ
āĻŦāĻā§āĻā§āĻ, āϝ⧠āĻāĻžāϰāĻŖā§ āĻĻā§āĻāĻŋ āĻĢāĻžāĻāĻļāύ āĻāĻāύā§āĻ āĻāĻ ā§āϰāĻāĻžāĻŦā§ āϏāĻŽāĻžāύ āĻšāϝāĻŧ āύāĻž, āĻāĻŽāύāĻāĻŋ āϤāĻžāϰāĻž āϝāĻĻāĻŋ āĻšā§āĻŦāĻšā§ āĻāĻāĻ āĻšā§: āϤāĻžāĻĻā§āϰ āĻāĻžāĻā§ āĻŽā§āĻŽāϰāĻŋāϤ⧠āĻāϞāĻžāĻĻāĻž āĻāϞāĻžāĻĻāĻž āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻĨāĻžāĻā§āĨ¤
-
---
@@ -3810,18 +3809,18 @@ console.log(person);
#### āĻāϤā§āϤāϰ: C
-Both the `changeAge` and `changeAgeAndName` functions have a default parameter, namely a _newly_ created object `{ ...person }`. This object has copies of all the key/values in the `person` object.
+`changeAge` āĻāĻŦāĻ `changeAgeAndName` āĻāĻāϝāĻŧ āĻĢāĻžāĻāĻļāύā§āϰāĻ āĻāĻāĻāĻŋ āĻĄāĻŋāĻĢāϞā§āĻ āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ āĻāĻā§, āĻāϞā§āϞā§āĻā§āϝ āĻāϰāĻž _āύāϤā§āύ_ āϤā§āϰāĻŋāĻā§āϤ āĻ
āĻŦāĻā§āĻā§āĻ `{ ...person }`āĨ¤ āĻāĻ āĻ
āĻŦāĻā§āĻā§āĻā§ `person` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āϏāĻŽāϏā§āϤ āĻā§/āĻā§āϝāĻžāϞā§āĻā§āϞāĻŋāϰ āĻāĻĒāĻŋ āϰāϝāĻŧā§āĻā§ā§ˇ
-First, we invoke the `changeAge` function and pass the `person` object as its argument. This function increases the value of the `age` property by 1. `person` is now `{ name: "Lydia", age: 22 }`.
+āĻĒā§āϰāĻĨāĻŽāϤ, āĻāĻŽāϰāĻž `changeAge` āĻĢāĻžāĻāĻļāύāĻā§ āĻāϞ āĻāϰāĻŋ āĻāĻŦāĻ `person` āĻ
āĻŦāĻā§āĻā§āĻāĻāĻŋāĻā§ āĻāϰ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻšāĻŋāϏā§āĻŦā§ āĻĒāĻžāϏ āĻāϰāĻŋāĨ¤ āĻāĻ āĻĢāĻžāĻāĻļāύāĻāĻŋ `age` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻŽāĻžāύ 1 āĻĻā§āĻŦāĻžāϰāĻž āĻŦā§āĻĻā§āϧāĻŋ āĻāϰā§āĨ¤ `person` āĻāĻāύ `{ name: "Lydia", age: 22 }`āĨ¤
-Then, we invoke the `changeAgeAndName` function, however we don't pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it's a new object, it doesn't affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Lydia", age: 22 }`.
+āϤāĻžāϰāĻĒāϰ, āĻāĻŽāϰāĻž `changeAgeAndName` āĻĢāĻžāĻāĻļāύ āĻāϞ āĻāϰāĻŋ, āϤāĻŦā§ āĻāĻŽāϰāĻž āĻā§āύ⧠āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ āĻĒāĻžāϏ āĻāϰāĻŋāύāĻŋāĨ¤ āĻĢāϞā§, `x` āĻāϰ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ āĻšā§ _āύāϤā§āύ_ āϤā§āϰāĻŋāĻā§āϤ āĻ
āĻŦāĻā§āĻā§āĻ `{ ...person }`āĨ¤ āϝā§āĻšā§āϤ⧠āĻāĻāĻŋ āĻāĻāĻāĻŋ āύāϤā§āύ āĻ
āĻŦāĻā§āĻā§āĻ, āĻāĻāĻŋ `person` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞā§āĻā§ āĻĒā§āϰāĻāĻžāĻŦāĻŋāϤ āĻāϰ⧠āύāĻžāĨ¤ `person` āĻāĻāύāĻ `{ name: "Lydia", age: 22 }` āĻāϰ āϏāĻŽāĻžāύāĨ¤
---
-###### 117. Which of the following options will return `6`?
+###### 117. āĻāϞā§āϞā§āĻā§āϝ āĻā§āύ āĻ
āĻĒāĻļāύāĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`6`?
```javascript
function sumValues(x, y, z) {
@@ -3839,7 +3838,7 @@ function sumValues(x, y, z) {
#### āĻāϤā§āϤāϰ: C
-With the spread operator `...`, we can _spread_ iterables to individual elements. The `sumValues` function receives three arguments: `x`, `y` and `z`. `...[1, 2, 3]` will result in `1, 2, 3`, which we pass to the `sumValues` function.
+āϏā§āĻĒā§āϰā§āĻĄ āĻ
āĻĒāĻžāϰā§āĻāϰ āĻĻāĻŋā§ā§ `...`, āĻāĻŽāϰāĻž āĻāĻāĻžāϰā§āĻŦāϞ āĻā§āϞā§āĻā§ āĻāϞāĻĻāĻž āĻāϞāĻŋāĻŽā§āύā§āĻā§ āϏā§āĻĒā§āϰā§āĻĄ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ `sumValues` āĻĢāĻžāĻāĻļāύāĻāĻŋ ā§ŠāĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āϰāĻŋāϏāĻŋāĻ āĻāϰāĻā§ `x`, `y` āĻ `z`āĨ¤ āĻā§āĻŦāϞ `...[1, 2, 3]` -āĻāϰ āĻĢāϞāĻžāĻĢāϞ āĻšā§ `1, 2, 3`, āϝā§āĻāĻž āĻāĻŽāϰāĻž `sumValues` āĻĢāĻžāĻāĻļāύ⧠āĻĒāĻžāϏ āĻāϰā§āĻāĻŋāĨ¤
@@ -3865,7 +3864,7 @@ console.log(list[(num += 1)]);
#### āĻāϤā§āϤāϰ: B
-With the `+=` operator, we're incrementing the value of `num` by `1`. `num` had the initial value `1`, so `1 + 1` is `2`. The item on the second index in the `list` array is đĨ°, `console.log(list[2])` prints đĨ°.
+`+=` āĻ
āĻĒāĻžāϰā§āĻāϰ āĻĻāĻŋā§ā§, āĻāĻŽāϰāĻž `num` āĻāϰ āĻā§āϝāĻžāϞ⧠`1` āĻŦā§āĻĻā§āϧāĻŋ āĻāϰāĻāĻŋāĨ¤ `num` āĻāϰ āĻĒā§āϰāĻžāĻĨāĻŽāĻŋāĻ āĻā§āϝāĻžāϞ⧠āĻāĻŋāϞ `1`, āĻĢāϞ⧠`1 + 1` āĻšā§ `2`āĨ¤ `list` āĻ
ā§āϝāĻžāϰā§āϰ ⧍ āύāĻžāĻŽā§āĻŦāĻžāϰ āĻāύāĻĄā§āĻā§āϏ āĻāĻāĻā§āĻŽā§āϰ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāĻā§āĻž āϝāĻžā§ đĨ°, `console.log(list[2])` āĻĒā§āϰāĻŋāύā§āĻ āĻāϰāĻā§ đĨ°āĨ¤
@@ -3903,12 +3902,15 @@ console.log(member.getLastName?.());
#### āĻāϤā§āϤāϰ: B
-With the optional chaining operator `?.`, we no longer have to explicitly check whether the deeper nested values are valid or not. If we're trying to access a property on an `undefined` or `null` value (_nullish_), the expression short-circuits and returns `undefined`.
+āĻ
āĻĒāĻļāύāĻžāϞ āĻā§āĻāύāĻŋāĻ āĻ
āĻĒāĻžāϰā§āĻāϰ `?.` āĻĻāĻŋā§ā§, āĻā§āύ āĻĄāĻŋāĻĒāĻžāϰ āύā§āϏā§āĻā§āĻĄ āĻā§āϝāĻžāϞā§āĻā§āϞ⧠āĻā§āϝāĻžāϞāĻŋāĻĄ āĻāĻŋāύāĻž āϤāĻž āĻāĻŽāĻžāĻĻā§āϰ āϏāϰāĻžāϏāϰāĻŋ āĻā§āĻ āĻāϰāĻžāϰ āĻĒā§āϰā§ā§āĻāύ āĻšā§ āύāĻž āϝā§āĨ¤ āϝāĻĻāĻŋ āĻāĻŽāϰāĻž āĻā§āύ `undefined` āĻŦāĻž `null` āĻā§āϝāĻžāϞ⧠(_āύāĻžāϞāĻŋāĻļ_) āĻā§ āĻāĻā§āϏā§āϏ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻŋ, āĻāĻā§āϏāĻĒā§āϰā§āĻļāύāĻāĻŋ āϏā§āĻāĻžāύā§āĻ āĻāĻžāĻ āĻāϰāĻž āĻŦāύā§āϧ āĻāϰ⧠āĻĻā§ā§ āĻāĻŦāĻ `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤
+
+- `person.pet?.name` āĻāϰ āĻā§āώā§āϤā§āϰā§, `person` āĻ
āĻŦāĻā§āĻā§āĻā§ `pet` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻāĻā§āĻ `person.pet` āύāĻžāϞāĻŋāĻļ āύā§āĨ¤ āĻāĻāĻžā§ `name` āύāĻžāĻŽā§āϰ āĻāĻāĻāĻŋ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻāĻā§, āĻāĻŦāĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§ `Mara`āĨ¤
+
+- `person.pet?.family?.name` āĻāϰ āĻā§āώā§āϤā§āϰā§, `person` āĻ
āĻŦāĻā§āĻā§āĻā§ `pet` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻāĻā§āĻ `person.pet` āύāĻžāϞāĻŋāĻļ āύā§āĨ¤ āĻāĻāĻžā§ `family` āύāĻžāĻŽā§āϰ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āύā§āĻ, `person.pet.family` āĻšāϞ⧠āύāĻžāϞāĻŋāĻļāĨ¤ āĻāĻā§āϏāĻĒā§āϰā§āĻļāύāĻāĻŋ `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤
+
+- `person.getFullName?.()` āĻāϰ āĻā§āώāϤā§āϰā§, `person` āĻ
āĻŦāĻā§āĻā§āĻā§ `getFullName` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻāĻā§āĻ `person.getFullName()` āύāĻžāϞāĻŋāĻļ āύ⧠āĻāĻŦāĻ āĻāϞ āĻāϰāϤ⧠āĻĒā§āϰā§āĻā§, āϝā§āĻāĻž `Lydia Hallie` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§āĨ¤
-`person.pet?.name`: `person` has a property named `pet`: `person.pet` is not nullish. It has a property called `name`, and returns `Mara`.
-`person.pet?.family?.name`: `person` has a property named `pet`: `person.pet` is not nullish. `pet` does _not_ have a property called `family`, `person.pet.family` is nullish. The expression returns `undefined`.
-`person.getFullName?.()`: `person` has a property named `getFullName`: `person.getFullName()` is not nullish and can get invoked, which returns `Lydia Hallie`.
-`member.getLastName?.()`: variable `member` is non-existent therefore a `ReferenceError` gets thrown!
+- `member.getLastName?.()` āĻāϰ āĻā§āώā§āϤā§āϰā§, `member` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻāĻŋāĻā§āĻ āĻĒāĻžāĻā§āĻž āϝāĻžāĻā§āĻā§ āύāĻž āĻŦāϞ⧠`ReferenceError` āĻāĻāĻā§āĨ¤
@@ -3937,7 +3939,7 @@ if (groceries.indexOf('banana')) {
#### āĻāϤā§āϤāϰ: B
-We passed the condition `groceries.indexOf("banana")` to the if-statement. `groceries.indexOf("banana")` returns `0`, which is a falsy value. Since the condition in the if-statement is falsy, the code in the `else` block runs, and `We don't have to buy bananas!` gets logged.
+āĻāĻŽāϰāĻž āĻāĻĢ-āĻāϞāϏ āϏā§āĻā§āĻāĻŽā§āύā§āĻā§ `groceries.indexOf("banana")` āĻļāϰā§āϤ āĻĻāĻŋā§ā§āĻāĻŋāĨ¤ `groceries.indexOf("banana")` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`0`, āϝā§āĻāĻž āĻĢāϞāϏāĻŋ āĻā§āϝāĻžāϞā§āĨ¤ āϝā§āϤā§āϤ⧠āĻāĻĢ-āĻāϞāϏ āϏā§āĻā§āĻāĻŽā§āύā§āĻā§āϰ āĻļāϰā§āϤ āĻĢāϞāϏāĻŋ, āϤāĻžāĻ `else` āĻŦā§āϞāĻā§āϰ āĻā§āĻĄāĻāĻŋ āĻāϞā§āĻā§, āĻāĻŦāĻ `We don't have to buy bananas!` āϞāĻ āĻšā§ā§āĻā§āĨ¤
@@ -3967,7 +3969,7 @@ console.log(config.language);
#### āĻāϤā§āϤāϰ: D
-The `language` method is a `setter`. Setters don't hold an actual value, their purpose is to _modify_ properties. When calling a `setter` method, `undefined` gets returned.
+`language` āĻŽā§āĻĨāĻĄāĻāĻŋ āĻšāϞ⧠āĻāĻāĻāĻŋ `setter`āĨ¤ Setters āĻā§āύ āĻā§āϝāĻžāϞā§āĻā§āĻ āϧāϰ⧠āϰāĻžāĻā§ āύāĻž, āϤāĻžāĻĻā§āϰ āĻāĻĻā§āĻĻā§āϝā§āĻļāĻ āĻšāϞ⧠āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻā§āϞā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāĻžāĨ¤ āϝāĻāύ `setter` āĻŽā§āĻĨāĻĄ āĻāϞ āĻāϰāĻž āĻšā§, `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤
@@ -3993,9 +3995,9 @@ console.log(!typeof name === 'string');
#### āĻāϤā§āϤāϰ: C
-`typeof name` returns `"string"`. The string `"string"` is a truthy value, so `!typeof name` returns the boolean value `false`. `false === "object"` and `false === "string"` both return`false`.
+`typeof name` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`"string"`āĨ¤ āϏā§āĻā§āϰāĻŋāĻ - `"string"` āĻšāϞ⧠āĻāĻāĻāĻŋ āϏāϤā§āϝ āĻā§āϝāĻžāϞā§, āϤāĻžāĻ `!typeof name` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠āĻŦā§āϞāĻŋā§āĻžāύ āĻā§āϝāĻžāϞ⧠`false`āĨ¤ `false === "object"` āĻāĻŦāĻ `false === "string"` āĻāĻā§ā§āĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`false`āĨ¤
-(If we wanted to check whether the type was (un)equal to a certain type, we should've written `!==` instead of `!typeof`)
+(āϝāĻĻāĻŋ āĻāĻŽāϰāĻž āĻā§āĻ āĻāϰāϤ⧠āĻāĻžāĻāϤāĻžāĻŽ āϝ⧠āĻā§āύ āĻāĻāĻāĻŋ āĻāĻžāĻāĻĒ āĻāĻāĻāĻŋ āύāĻŋāϰā§āĻĻāĻŋāώā§āĻ āĻāĻžāĻāĻĒā§āϰ (āĻ
)āϏāĻŽāĻžāύ āĻāĻŋāύāĻž, āĻāĻŽāĻžāĻĻā§āϰ `!typeof` āĻāϰ āĻĒāϰāĻŋāĻŦāϰā§āϤ⧠`!==` āϞā§āĻāĻž āĻāĻāĻŋā§ āĻāĻŋāϞ āĨ¤)
From 098e645ce5c2900ca3771562f7767eb4d7ab1b6c Mon Sep 17 00:00:00 2001
From: iamsaief
Date: Sat, 20 Jul 2024 22:50:18 +0600
Subject: [PATCH 10/12] added translation till 133
---
bn-BD/README_bn-BD.md | 460 +++++++++++++++++++++---------------------
1 file changed, 232 insertions(+), 228 deletions(-)
diff --git a/bn-BD/README_bn-BD.md b/bn-BD/README_bn-BD.md
index 5284585b..af201342 100644
--- a/bn-BD/README_bn-BD.md
+++ b/bn-BD/README_bn-BD.md
@@ -52,7 +52,7 @@
function sayHi() {
console.log(name);
console.log(age);
- var name = 'Lydia';
+ var name = "Lydia";
let age = 21;
}
@@ -148,7 +148,7 @@ console.log(shape.perimeter());
```javascript
+true;
-!'Lydia';
+!"Lydia";
```
- A: `1` and `false`
@@ -173,11 +173,11 @@ console.log(shape.perimeter());
```javascript
const bird = {
- size: 'small',
+ size: "small",
};
const mouse = {
- name: 'Mickey',
+ name: "Mickey",
small: true,
};
```
@@ -206,11 +206,11 @@ const mouse = {
###### 6. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-let c = { greeting: 'Hey!' };
+let c = { greeting: "Hey!" };
let d;
d = c;
-c.greeting = 'Hello';
+c.greeting = "Hello";
console.log(d.greeting);
```
@@ -280,13 +280,13 @@ class Chameleon {
return this.newColor;
}
- constructor({ newColor = 'green' } = {}) {
+ constructor({ newColor = "green" } = {}) {
this.newColor = newColor;
}
}
-const freddie = new Chameleon({ newColor: 'purple' });
-console.log(freddie.colorChange('orange'));
+const freddie = new Chameleon({ newColor: "purple" });
+console.log(freddie.colorChange("orange"));
```
- A: `orange`
@@ -341,10 +341,10 @@ console.log(greetign);
```javascript
function bark() {
- console.log('Woof!');
+ console.log("Woof!");
}
-bark.animal = 'dog';
+bark.animal = "dog";
```
- A: Nothing, this is totally fine!
@@ -374,7 +374,7 @@ function Person(firstName, lastName) {
this.lastName = lastName;
}
-const member = new Person('Lydia', 'Hallie');
+const member = new Person("Lydia", "Hallie");
Person.getFullName = function () {
return `${this.firstName} ${this.lastName}`;
};
@@ -415,8 +415,8 @@ function Person(firstName, lastName) {
this.lastName = lastName;
}
-const lydia = new Person('Lydia', 'Hallie');
-const sarah = Person('Sarah', 'Smith');
+const lydia = new Person("Lydia", "Hallie");
+const sarah = Person("Sarah", "Smith");
console.log(lydia);
console.log(sarah);
@@ -486,7 +486,7 @@ function sum(a, b) {
return a + b;
}
-sum(1, '2');
+sum(1, "2");
```
- A: `NaN`
@@ -553,7 +553,7 @@ function getPersonInfo(one, two, three) {
console.log(three);
}
-const person = 'Lydia';
+const person = "Lydia";
const age = 21;
getPersonInfo`${person} is ${age} years old`;
@@ -580,9 +580,9 @@ getPersonInfo`${person} is ${age} years old`;
```javascript
function checkAge(data) {
if (data === { age: 18 }) {
- console.log('You are an adult!');
+ console.log("You are an adult!");
} else if (data == { age: 18 }) {
- console.log('You are still an adult.');
+ console.log("You are still an adult.");
} else {
console.log(`Hmm.. You don't have an age I guess`);
}
@@ -642,7 +642,7 @@ getAge(21);
```javascript
function getAge() {
- 'use strict';
+ "use strict";
age = 21;
console.log(age);
}
@@ -670,7 +670,7 @@ getAge();
###### 21. āĻā§āύāĻāĻŋ `sum` āĻāϰ āĻā§āϝāĻžāϞ⧠āĻšāĻŦā§?
```javascript
-const sum = eval('10*10+5');
+const sum = eval("10*10+5");
```
- A: `105`
@@ -693,7 +693,7 @@ const sum = eval('10*10+5');
###### 22. āĻāϤāĻā§āώāĻŖ cool_secret āĻāĻā§āϏā§āϏāϝā§āĻā§āϝ?
```javascript
-sessionStorage.setItem('cool_secret', 123);
+sessionStorage.setItem("cool_secret", 123);
```
- A: Forever, the data doesn't get lost.
@@ -746,12 +746,12 @@ console.log(num);
###### 24. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const obj = { 1: 'a', 2: 'b', 3: 'c' };
+const obj = { 1: "a", 2: "b", 3: "c" };
const set = new Set([1, 2, 3, 4, 5]);
-obj.hasOwnProperty('1');
+obj.hasOwnProperty("1");
obj.hasOwnProperty(1);
-set.has('1');
+set.has("1");
set.has(1);
```
@@ -777,7 +777,7 @@ set.has(1);
###### 25. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const obj = { a: 'one', b: 'two', a: 'three' };
+const obj = { a: "one", b: "two", a: "three" };
console.log(obj);
```
@@ -846,10 +846,10 @@ for (let i = 1; i < 5; i++) {
```javascript
String.prototype.giveLydiaPizza = () => {
- return 'Just give Lydia pizza already!';
+ return "Just give Lydia pizza already!";
};
-const name = 'Lydia';
+const name = "Lydia";
console.log(name.giveLydiaPizza());
```
@@ -877,8 +877,8 @@ console.log(name.giveLydiaPizza());
```javascript
const a = {};
-const b = { key: 'b' };
-const c = { key: 'c' };
+const b = { key: "b" };
+const c = { key: "c" };
a[b] = 123;
a[c] = 456;
@@ -910,9 +910,9 @@ console.log(a[b]);
###### 30. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const foo = () => console.log('First');
-const bar = () => setTimeout(() => console.log('Second'));
-const baz = () => console.log('Third');
+const foo = () => console.log("First");
+const bar = () => setTimeout(() => console.log("Second"));
+const baz = () => console.log("Third");
bar();
foo();
@@ -1018,7 +1018,7 @@ If we click `p`, we see two logs: `p` and `div`. During event propagation, there
###### 33. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const person = { name: 'Lydia' };
+const person = { name: "Lydia" };
function sayHi(age) {
return `${this.name} is ${age}`;
@@ -1081,8 +1081,8 @@ console.log(typeof sayHi());
```javascript
0;
new Number(0);
-('');
-(' ');
+("");
+(" ");
new Boolean(false);
undefined;
```
@@ -1265,7 +1265,7 @@ console.log(numbers);
```javascript
!!null;
-!!'';
+!!"";
!!1;
```
@@ -1295,7 +1295,7 @@ console.log(numbers);
###### 42. āĻāĻ `setInterval` āĻŽā§āĻĨāĻĄāĻāĻŋ āĻŦā§āϰāĻžāĻāĻāĻžāϰ⧠āĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§?
```javascript
-setInterval(() => console.log('Hi'), 1000);
+setInterval(() => console.log("Hi"), 1000);
```
- A: a unique id
@@ -1318,7 +1318,7 @@ setInterval(() => console.log('Hi'), 1000);
###### 43. āĻāĻāĻž āĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§?
```javascript
-[...'Lydia'];
+[..."Lydia"];
```
- A: `["L", "y", "d", "i", "a"]`
@@ -1377,11 +1377,11 @@ console.log(gen.next().value);
```javascript
const firstPromise = new Promise((res, rej) => {
- setTimeout(res, 500, 'one');
+ setTimeout(res, 500, "one");
});
const secondPromise = new Promise((res, rej) => {
- setTimeout(res, 100, 'two');
+ setTimeout(res, 100, "two");
});
Promise.race([firstPromise, secondPromise]).then((res) => console.log(res));
@@ -1407,7 +1407,7 @@ Promise.race([firstPromise, secondPromise]).then((res) => console.log(res));
###### 46. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-let person = { name: 'Lydia' };
+let person = { name: "Lydia" };
const members = [person];
person = null;
@@ -1447,7 +1447,7 @@ console.log(members);
```javascript
const person = {
- name: 'Lydia',
+ name: "Lydia",
age: 21,
};
@@ -1476,7 +1476,7 @@ for (const item in person) {
###### 48. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-console.log(3 + 4 + '5');
+console.log(3 + 4 + "5");
```
- A: `"345"`
@@ -1503,7 +1503,7 @@ console.log(3 + 4 + '5');
###### 49. `num` āĻāϰ āĻā§āϝāĻžāϞ⧠āĻā§āύāĻāĻŋ?
```javascript
-const num = parseInt('7*6', 10);
+const num = parseInt("7*6", 10);
```
- A: `42`
@@ -1529,7 +1529,7 @@ const num = parseInt('7*6', 10);
```javascript
[1, 2, 3].map((num) => {
- if (typeof num === 'number') return;
+ if (typeof num === "number") return;
return num * 2;
});
```
@@ -1557,12 +1557,12 @@ const num = parseInt('7*6', 10);
```javascript
function getInfo(member, year) {
- member.name = 'Lydia';
- year = '1998';
+ member.name = "Lydia";
+ year = "1998";
}
-const person = { name: 'Sarah' };
-const birthYear = '1997';
+const person = { name: "Sarah" };
+const birthYear = "1997";
getInfo(person, birthYear);
@@ -1594,15 +1594,15 @@ console.log(person, birthYear);
```javascript
function greeting() {
- throw 'Hello world!';
+ throw "Hello world!";
}
function sayHi() {
try {
const data = greeting();
- console.log('It worked!', data);
+ console.log("It worked!", data);
} catch (e) {
- console.log('Oh no an error:', e);
+ console.log("Oh no an error:", e);
}
}
@@ -1632,8 +1632,8 @@ sayHi();
```javascript
function Car() {
- this.make = 'Lamborghini';
- return { make: 'Maserati' };
+ this.make = "Lamborghini";
+ return { make: "Maserati" };
}
const myCar = new Car();
@@ -1711,7 +1711,7 @@ Dog.prototype.bark = function () {
console.log(`Woof I am ${this.name}`);
};
-const pet = new Dog('Mara');
+const pet = new Dog("Mara");
pet.bark();
@@ -1776,7 +1776,7 @@ export default counter;
```javascript
// index.js
-import myCounter from './counter';
+import myCounter from "./counter";
myCounter += 1;
@@ -1805,7 +1805,7 @@ console.log(myCounter);
###### 58. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const name = 'Lydia';
+const name = "Lydia";
age = 21;
console.log(delete name);
@@ -1876,7 +1876,7 @@ console.log(y);
###### 60. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const user = { name: 'Lydia', age: 21 };
+const user = { name: "Lydia", age: 21 };
const admin = { admin: true, ...user };
console.log(admin);
@@ -1902,9 +1902,9 @@ console.log(admin);
###### 61. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const person = { name: 'Lydia' };
+const person = { name: "Lydia" };
-Object.defineProperty(person, 'age', { value: 21 });
+Object.defineProperty(person, "age", { value: 21 });
console.log(person);
console.log(Object.keys(person));
@@ -1933,12 +1933,12 @@ console.log(Object.keys(person));
```javascript
const settings = {
- username: 'lydiahallie',
+ username: "lydiahallie",
level: 19,
health: 90,
};
-const data = JSON.stringify(settings, ['level', 'health']);
+const data = JSON.stringify(settings, ["level", "health"]);
console.log(data);
```
@@ -2126,12 +2126,12 @@ class Labrador extends Dog {
```javascript
// index.js
-console.log('running index.js');
-import { sum } from './sum.js';
+console.log("running index.js");
+import { sum } from "./sum.js";
console.log(sum(1, 2));
// sum.js
-console.log('running sum.js');
+console.log("running sum.js");
export const sum = (a, b) => a + b;
```
@@ -2159,7 +2159,7 @@ export const sum = (a, b) => a + b;
```javascript
console.log(Number(2) === Number(2));
console.log(Boolean(false) === Boolean(false));
-console.log(Symbol('foo') === Symbol('foo'));
+console.log(Symbol("foo") === Symbol("foo"));
```
- A: `true`, `true`, `false`
@@ -2182,7 +2182,7 @@ console.log(Symbol('foo') === Symbol('foo'));
###### 69. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const name = 'Lydia Hallie';
+const name = "Lydia Hallie";
console.log(name.padStart(13));
console.log(name.padStart(2));
```
@@ -2209,7 +2209,7 @@ console.log(name.padStart(2));
###### 70. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-console.log('đĨ' + 'đģ');
+console.log("đĨ" + "đģ");
```
- A: `"đĨđģ"`
@@ -2233,11 +2233,11 @@ console.log('đĨ' + 'đģ');
```javascript
function* startGame() {
- const answer = yield 'Do you love JavaScript?';
- if (answer !== 'Yes') {
+ const answer = yield "Do you love JavaScript?";
+ if (answer !== "Yes") {
return "Oh wow... Guess we're done here";
}
- return 'JavaScript loves you back â¤ī¸';
+ return "JavaScript loves you back â¤ī¸";
}
const game = startGame();
@@ -2305,7 +2305,7 @@ console.log(String.raw`Hello\nworld`);
```javascript
async function getData() {
- return await Promise.resolve('I made it!');
+ return await Promise.resolve("I made it!");
}
const data = getData();
@@ -2342,7 +2342,7 @@ function addToList(item, list) {
return list.push(item);
}
-const result = addToList('apple', ['banana']);
+const result = addToList("apple", ["banana"]);
console.log(result);
```
@@ -2402,7 +2402,7 @@ console.log(shape);
###### 76. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const { firstName: myName } = { firstName: 'Lydia' };
+const { firstName: myName } = { firstName: "Lydia" };
console.log(firstName);
```
@@ -2420,7 +2420,7 @@ console.log(firstName);
[āĻĄāĻŋāϏā§āĻā§āϰāĻžāĻāĻāĻžāϰāĻŋāĻ āĻ
ā§āϝāĻžāϏāĻžāĻāύāĻŽā§āύā§āĻ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) āϏāĻŋāύāĻā§āϝāĻžāĻā§āϏ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§, āĻāĻŽāϰāĻž āĻ
ā§āϝāĻžāϰā§āϰ āĻā§āϝāĻžāϞā§, āĻŦāĻž āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻŦā§āϰ āĻāϰ⧠āĻāϞāĻžāĻĻāĻž āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞ⧠āϰāĻžāĻāϤ⧠āĻĒāĻžāϰāĻŋāĻ
```javascript
-const { firstName } = { firstName: 'Lydia' };
+const { firstName } = { firstName: "Lydia" };
// ES5 version:
// var firstName = { firstName: 'Lydia' }.firstName;
@@ -2430,7 +2430,7 @@ console.log(firstName); // "Lydia"
āĻāĻŦāĻžāϰ, āĻ
āĻŦāĻā§āĻā§āĻ āĻĨā§āĻā§ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻŦā§āϰ āĻāϰ⧠āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āύāĻžāĻŽā§ āύāĻž āϰā§āĻā§ āĻ
āύā§āϝ āύāĻžāĻŽā§āϰ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞā§āĻ āϰāĻžāĻāϤ⧠āĻĒāĻžāϰāĻŋāĻ
```javascript
-const { firstName: myName } = { firstName: 'Lydia' };
+const { firstName: myName } = { firstName: "Lydia" };
// ES5 version:
// var myName = { firstName: 'Lydia' }.firstName;
@@ -2443,7 +2443,7 @@ console.log(firstName); // Uncaught ReferenceError: firstName is not defined
**āĻĻā§āϰāώā§āĻāĻŦā§āϝ:** `āĻā§āϞā§āĻŦāĻžāϞ āϏā§āĻā§āĻĒ` āĻŦā§āĻļāĻŋāώā§āĻā§āϝ āϏāĻŽā§āĻĒāϰā§āĻā§ āϏāĻā§āϤāύ āĻĨāĻžāĻā§āύ:
```javascript
-const { name: myName } = { name: 'Lydia' };
+const { name: myName } = { name: "Lydia" };
console.log(myName); // "lydia"
console.log(name); // "" ----- Browser e.g. Chrome
@@ -2538,7 +2538,7 @@ console.log(addFunction(5 * 2));
###### 79. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const myLifeSummedUp = ['â', 'đģ', 'đˇ', 'đĢ'];
+const myLifeSummedUp = ["â", "đģ", "đˇ", "đĢ"];
for (let item in myLifeSummedUp) {
console.log(item);
@@ -2634,13 +2634,13 @@ console.log(sayHi());
###### 82. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-var status = 'đ';
+var status = "đ";
setTimeout(() => {
- const status = 'đ';
+ const status = "đ";
const data = {
- status: 'đĨ',
+ status: "đĨ",
getStatus() {
return this.status;
},
@@ -2674,12 +2674,12 @@ setTimeout(() => {
```javascript
const person = {
- name: 'Lydia',
+ name: "Lydia",
age: 21,
};
let city = person.city;
-city = 'Amsterdam';
+city = "Amsterdam";
console.log(person);
```
@@ -2743,7 +2743,7 @@ console.log(checkAge(21));
###### 85. āĻāĻāĻžāύ⧠āĻāĻŋ āϧāϰāύā§āϰ āϤāĻĨā§āϝ āϞāĻ āĻšāϤ⧠āĻĒāĻžāϰā§?
```javascript
-fetch('https://www.website.com/api/user/1')
+fetch("https://www.website.com/api/user/1")
.then((res) => res.json())
.then((res) => console.log(res));
```
@@ -2799,7 +2799,7 @@ D-āϰ āĻā§āώā§āϤā§āϰā§, `name.length` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§
###### 87. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-console.log('I want pizza'[0]);
+console.log("I want pizza"[0]);
```
- A: `"""`
@@ -2854,11 +2854,11 @@ sum(10);
```javascript
// module.js
-export default () => 'Hello world';
-export const name = 'Lydia';
+export default () => "Hello world";
+export const name = "Lydia";
// index.js
-import * as data from './module';
+import * as data from "./module";
console.log(data);
```
@@ -2891,7 +2891,7 @@ class Person {
}
}
-const member = new Person('John');
+const member = new Person("John");
console.log(typeof member);
```
@@ -2951,11 +2951,10 @@ console.log(newList.push(5));
```javascript
function giveLydiaPizza() {
- return 'Here is pizza!';
+ return "Here is pizza!";
}
-const giveLydiaChocolate = () =>
- "Here's chocolate... now go hit the gym already.";
+const giveLydiaChocolate = () => "Here's chocolate... now go hit the gym already.";
console.log(giveLydiaPizza.prototype);
console.log(giveLydiaChocolate.prototype);
@@ -2982,7 +2981,7 @@ console.log(giveLydiaChocolate.prototype);
```javascript
const person = {
- name: 'Lydia',
+ name: "Lydia",
age: 21,
};
@@ -3043,7 +3042,7 @@ function getItems(fruitList, favoriteFruit, ...args) {
return [...fruitList, ...args, favoriteFruit];
}
-getItems(['banana', 'apple'], 'pear', 'orange');
+getItems(["banana", "apple"], "pear", "orange");
```
āĻāĻĒāϰā§āϰ āĻāĻĻāĻžāĻšāϰāĻŖāĻāĻŋ āϏāĻ āĻŋāĻāĻāĻžāĻŦā§ āĻāĻžāĻ āĻāϰā§āĨ¤ āĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠`[ 'banana', 'apple', 'orange', 'pear' ]` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠āĻĻā§āϝāĻŧāĨ¤
@@ -3057,8 +3056,8 @@ getItems(['banana', 'apple'], 'pear', 'orange');
```javascript
function nums(a, b) {
- if (a > b) console.log('a is bigger');
- else console.log('b is bigger');
+ if (a > b) console.log("a is bigger");
+ else console.log("b is bigger");
return;
a + b;
}
@@ -3098,13 +3097,13 @@ a + b;
```javascript
class Person {
constructor() {
- this.name = 'Lydia';
+ this.name = "Lydia";
}
}
Person = class AnotherPerson {
constructor() {
- this.name = 'Sarah';
+ this.name = "Sarah";
}
};
@@ -3133,7 +3132,7 @@ console.log(member.name);
```javascript
const info = {
- [Symbol('a')]: 'b',
+ [Symbol("a")]: "b",
};
console.log(info);
@@ -3202,7 +3201,7 @@ console.log(getUser(user))
###### 99. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const name = 'Lydia';
+const name = "Lydia";
console.log(name());
```
@@ -3235,8 +3234,8 @@ console.log(name());
```javascript
// đ⨠This is my 100th question! â¨đ
-const output = `${[] && 'Im'}possible!
-You should${'' && `n't`} see a therapist after so much JavaScript lol`;
+const output = `${[] && "Im"}possible!
+You should${"" && `n't`} see a therapist after so much JavaScript lol`;
```
- A: `possible! You should see a therapist after so much JavaScript lol`
@@ -3262,7 +3261,7 @@ You should${'' && `n't`} see a therapist after so much JavaScript lol`;
```javascript
const one = false || {} || null;
-const two = null || false || '';
+const two = null || false || "";
const three = [] || 0 || true;
console.log(one, two, three);
@@ -3294,16 +3293,16 @@ console.log(one, two, three);
###### 102. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻā§āϰ āĻā§āϝāĻžāϞ⧠āĻāĻŋ?
```javascript
-const myPromise = () => Promise.resolve('I have resolved!');
+const myPromise = () => Promise.resolve("I have resolved!");
function firstFunction() {
myPromise().then((res) => console.log(res));
- console.log('second');
+ console.log("second");
}
async function secondFunction() {
console.log(await myPromise());
- console.log('second');
+ console.log("second");
}
firstFunction();
@@ -3341,8 +3340,8 @@ secondFunction();
const set = new Set();
set.add(1);
-set.add('Lydia');
-set.add({ name: 'Lydia' });
+set.add("Lydia");
+set.add({ name: "Lydia" });
for (let item of set) {
console.log(item + 2);
@@ -3402,13 +3401,13 @@ Promise.resolve(5);
```javascript
function compareMembers(person1, person2 = person) {
if (person1 !== person2) {
- console.log('Not the same!');
+ console.log("Not the same!");
} else {
- console.log('They are the same!');
+ console.log("They are the same!");
}
}
-const person = { name: 'Lydia' };
+const person = { name: "Lydia" };
compareMembers(person);
```
@@ -3445,7 +3444,7 @@ const colorConfig = {
yellow: false,
};
-const colors = ['pink', 'red', 'blue'];
+const colors = ["pink", "red", "blue"];
console.log(colorConfig.colors[1]);
```
@@ -3474,7 +3473,7 @@ console.log(colorConfig.colors[1]);
###### 107. āĻāĻāĻžāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻŋ āĻšāĻŦā§?
```javascript
-console.log('â¤ī¸' === 'â¤ī¸');
+console.log("â¤ī¸" === "â¤ī¸");
```
- A: `true`
@@ -3495,14 +3494,14 @@ console.log('â¤ī¸' === 'â¤ī¸');
###### 108. āĻāĻ āĻŽā§āĻĨāĻĄāĻā§āϞāĻŋāϰ āĻŽāϧā§āϝ⧠āĻā§āύāĻāĻŋ āĻŽā§āϞ āĻ
ā§āϝāĻžāϰ⧠āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§?
```javascript
-const emojis = ['â¨', 'đĨ', 'đ'];
+const emojis = ["â¨", "đĨ", "đ"];
-emojis.map((x) => x + 'â¨');
-emojis.filter((x) => x !== 'đĨ');
-emojis.find((x) => x !== 'đĨ');
-emojis.reduce((acc, cur) => acc + 'â¨');
-emojis.slice(1, 2, 'â¨');
-emojis.splice(1, 2, 'â¨');
+emojis.map((x) => x + "â¨");
+emojis.filter((x) => x !== "đĨ");
+emojis.find((x) => x !== "đĨ");
+emojis.reduce((acc, cur) => acc + "â¨");
+emojis.slice(1, 2, "â¨");
+emojis.splice(1, 2, "â¨");
```
- A: `All of them`
@@ -3527,10 +3526,10 @@ emojis.splice(1, 2, 'â¨');
###### 109. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const food = ['đ', 'đĢ', 'đĨ', 'đ'];
+const food = ["đ", "đĢ", "đĨ", "đ"];
const info = { favoriteFood: food[0] };
-info.favoriteFood = 'đ';
+info.favoriteFood = "đ";
console.log(food);
```
@@ -3584,7 +3583,7 @@ const jsonArray = JSON.stringify([1, 2, 3]); // '[1, 2, 3]'
JSON.parse(jsonArray); // [1, 2, 3]
// Stringifying an object into valid JSON, then parsing the JSON string to a JavaScript value:
-const jsonObject = JSON.stringify({ name: 'Lydia' }); // '{"name":"Lydia"}'
+const jsonObject = JSON.stringify({ name: "Lydia" }); // '{"name":"Lydia"}'
JSON.parse(jsonObject); // { name: 'Lydia' }
```
@@ -3596,11 +3595,11 @@ JSON.parse(jsonObject); // { name: 'Lydia' }
###### 111. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-let name = 'Lydia';
+let name = "Lydia";
function getName() {
console.log(name);
- let name = 'Sarah';
+ let name = "Sarah";
}
getName();
@@ -3623,7 +3622,7 @@ getName();
āϝāĻĻāĻŋ `name` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻāĻŋāĻā§ āĻāĻŽāϰāĻž `getName` āĻĢāĻžāĻāĻļāύ⧠āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āύāĻž āĻāϰāϤāĻžāĻŽ, āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻāĻā§āĻāĻŋāύ āϤāĻžāĻā§ _scope chain_ āĻāϰ āĻāĻŋāϤāϰ āĻā§āĻāĻā§ āĻĻā§āĻāϤāĨ¤ āĻŦāĻžāĻāϰā§āϰ āϏā§āĻā§āĻĒā§āĻ āĻāĻāĻāĻŋ `name` āĻā§āϝāĻžāϰāĻŋā§āĻžāĻŦāϞ āĻāĻā§ āϝāĻžāϰ āĻā§āϝāĻžāϞ⧠āĻāĻāĻāĻŋ āϏā§āĻā§āϰāĻŋāĻ - `Lydia`āĨ¤ āĻāĻā§āώā§āϤā§āϰā§, āĻāĻāĻž āϞāĻ āĻāϰāϤ `Lydia`āĨ¤
```javascript
-let name = 'Lydia';
+let name = "Lydia";
function getName() {
console.log(name);
@@ -3641,11 +3640,11 @@ getName(); // Lydia
```javascript
function* generatorOne() {
- yield ['a', 'b', 'c'];
+ yield ["a", "b", "c"];
}
function* generatorTwo() {
- yield* ['a', 'b', 'c'];
+ yield* ["a", "b", "c"];
}
const one = generatorOne();
@@ -3692,7 +3691,7 @@ console.log(two.next().value); // undefined
###### 113. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-console.log(`${((x) => x)('I love')} to program`);
+console.log(`${((x) => x)("I love")} to program`);
```
- A: `I love to program`
@@ -3717,7 +3716,7 @@ console.log(`${((x) => x)('I love')} to program`);
```javascript
let config = {
alert: setInterval(() => {
- console.log('Alert!');
+ console.log("Alert!");
}, 1000),
};
@@ -3747,16 +3746,16 @@ config = null;
```javascript
const myMap = new Map();
-const myFunc = () => 'greeting';
+const myFunc = () => "greeting";
-myMap.set(myFunc, 'Hello world!');
+myMap.set(myFunc, "Hello world!");
//1
-myMap.get('greeting');
+myMap.get("greeting");
//2
myMap.get(myFunc);
//3
-myMap.get(() => 'greeting');
+myMap.get(() => "greeting");
```
- A: 1
@@ -3783,14 +3782,14 @@ myMap.get(() => 'greeting');
```javascript
const person = {
- name: 'Lydia',
+ name: "Lydia",
age: 21,
};
const changeAge = (x = { ...person }) => (x.age += 1);
const changeAgeAndName = (x = { ...person }) => {
x.age += 1;
- x.name = 'Sarah';
+ x.name = "Sarah";
};
changeAge(person);
@@ -3849,7 +3848,7 @@ function sumValues(x, y, z) {
```javascript
let num = 1;
-const list = ['đĨŗ', 'đ¤ ', 'đĨ°', 'đ¤Ē'];
+const list = ["đĨŗ", "đ¤ ", "đĨ°", "đ¤Ē"];
console.log(list[(num += 1)]);
```
@@ -3875,11 +3874,11 @@ console.log(list[(num += 1)]);
```javascript
const person = {
- firstName: 'Lydia',
- lastName: 'Hallie',
+ firstName: "Lydia",
+ lastName: "Hallie",
pet: {
- name: 'Mara',
- breed: 'Dutch Tulip Hound',
+ name: "Mara",
+ breed: "Dutch Tulip Hound",
},
getFullName() {
return `${this.firstName} ${this.lastName}`;
@@ -3920,10 +3919,10 @@ console.log(member.getLastName?.());
###### 120. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const groceries = ['banana', 'apple', 'peanuts'];
+const groceries = ["banana", "apple", "peanuts"];
-if (groceries.indexOf('banana')) {
- console.log('We have to buy bananas!');
+if (groceries.indexOf("banana")) {
+ console.log("We have to buy bananas!");
} else {
console.log(`We don't have to buy bananas!`);
}
@@ -3979,10 +3978,10 @@ console.log(config.language);
###### 122. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const name = 'Lydia Hallie';
+const name = "Lydia Hallie";
-console.log(!typeof name === 'object');
-console.log(!typeof name === 'string');
+console.log(!typeof name === "object");
+console.log(!typeof name === "string");
```
- A: `false` `true`
@@ -4025,7 +4024,10 @@ add(4)(5)(6);
#### āĻāϤā§āϤāϰ: A
-The `add` function returns an arrow function, which returns an arrow function, which returns an arrow function (still with me?). The first function receives an argument `x` with the value of `4`. We invoke the second function, which receives an argument `y` with the value `5`. Then we invoke the third function, which receives an argument `z` with the value `6`. When we're trying to access the value `x`, `y` and `z` within the last arrow function, the JS engine goes up the scope chain in order to find the values for `x` and `y` accordingly. This returns `4` `5` `6`.
+`add` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āĻĢāĻžāĻāĻļāύ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠(āĻāĻā§ āĻŦāϞāĻž āĻšā§ curried function), āϝā§āĻāĻž āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āĻĢāĻžāĻāĻļāύ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§, āϝā§āĻāĻž āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āĻĢāĻžāĻāĻļāύ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠(āĻŽāĻžāĻĨāĻž āĻāĻžāϰāĻžāĻĒ āĻšāĻā§āĻā§ āύāĻžāϤ⧠đ¤¯)āĨ¤ ā§§āĻŽ āĻĢāĻžāĻāĻļāύ āĻāĻāĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āϰāĻŋāϏāĻŋāĻ āĻāϰ⧠`x` āϝāĻžāϰ āĻā§āϝāĻžāϞ⧠āĻšāϞ⧠`4`āĨ¤ āĻāĻŽāϰāĻž ⧍⧠āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāϞ āĻāϰāĻŋ, āϝā§āĻāĻž āĻāĻāĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āϰāĻŋāϏāĻŋāĻ āĻāϰ⧠`y` āϝāĻžāϰ āĻā§āϝāĻžāϞ⧠āĻšāϞ⧠`5`āĨ¤ āĻāϰāĻĒāϰ āĻāĻŽāϰāĻž ā§Šā§ āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāϞ āĻāϰāĻŋ, āϝā§āĻāĻž āĻāĻāĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āϰāĻŋāϏāĻŋāĻ āĻāϰ⧠`z` āϝāĻžāϰ āĻā§āϝāĻžāϞ⧠āĻšāϞ⧠`6`āĨ¤ āĻāĻŽāϰāĻž āϝāĻāύ āĻļā§āώ āĻ
ā§āϝāĻžāϰ⧠āĻĢāĻžāĻāĻļāύ⧠`x`, `y` āĻ `z` āĻā§āϝāĻžāϞā§āĻā§ āĻāĻā§āϏā§āϏ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻāĻŋ, āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻāĻā§āĻāĻŋāύ `x` āĻ `y` āĻāϰ āĻā§āϝāĻžāϞā§āĻā§āϞā§āϰ āĻāύā§āϝ āϤāĻžāĻĻā§āϰ āĻ
āĻŦāϏā§āĻĨāĻžāύ āĻ
āύā§āϏāĻžāϰ⧠āϏā§āĻā§āĻĒ āĻā§āĻāύā§āϰ āĻāĻĒāϰ⧠āϝāĻžāĻā§āĻā§āĨ¤ āϞāĻ āĻāϰāĻā§ `4` `5` `6` āĻāĻŦāĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§ `15`āĨ¤
+
+> - āĻā§āϝāĻžāϰāĻŋ āĻĢāĻžāĻāĻļāύ (curried functions) āĻā§āϞā§āĻāĻžāϰ ([closures](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures)) āĻāϰ āĻŽāĻžāϧā§āϝāĻŽā§ āĻāĻāĻžāϧāĻŋāĻ āĻĢāĻžāĻāĻļāύ āĻāϞā§āϰ āĻŽāϧā§āϝ⧠āϏā§āĻā§āĻ āĻŽā§āĻāύā§āĻā§āĻāύ āĻāϰā§āĨ¤ āĻĒā§āϰāϤāĻŋāĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻšāĻā§āĻž āĻĢāĻžāĻāĻļāύ āϤāĻžāϰ āϏā§āĻā§āĻĒ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞā§āϰ āĻā§āϝāĻžāϞā§āĻā§ āĻŽāύ⧠āϰāĻžāĻā§āĨ¤
+> - āϝāĻāύ āĻāĻĒāύāĻŋ `add(4)(5)(6)` āĻāϞ āĻāϰāĻā§āύ, āĻāύāĻžāϰ āĻĢāĻžāĻāĻļāύāĻā§āϞā§āϤ⧠`x` āĻ `y` āĻāϰ āĻā§āϝāĻžāϞ⧠āϝāĻĨāĻžāĻā§āϰāĻŽā§, `4` āĻ `5` āĻāϰ āĻāĻā§āϏā§āϏ āĻāĻāύ⧠āĻĨāĻžāĻāĻā§, āϝāĻĻāĻŋāĻ āϤāĻžāϰāĻž āĻāĻŋāύā§āύ āĻāύāĻā§āϝāĻžāĻā§āϏ⧠āĻāϞā§āĨ¤
@@ -4059,7 +4061,7 @@ async function* range(start, end) {
#### āĻāϤā§āϤāϰ: C
-The generator function `range` returns an async object with promises for each item in the range we pass: `Promise{1}`, `Promise{2}`, `Promise{3}`. We set the variable `gen` equal to the async object, after which we loop over it using a `for await ... of` loop. We set the variable `item` equal to the returned Promise values: first `Promise{1}`, then `Promise{2}`, then `Promise{3}`. Since we're _awaiting_ the value of `item`, the resolved promise, the resolved _values_ of the promises get returned: `1`, `2`, then `3`.
+āĻāĻŽāϰāĻž āϝ⧠āϰā§āĻā§āĻāĻāĻŋ āĻĒāĻžāϏ āĻāϰāĻāĻŋ āϤāĻžāĻĻā§āϰ āĻĒā§āϰāϤāĻŋāĻāĻŋāϰ āĻāύā§āϝ āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ `range` āĻĒā§āϰāĻŽāĻŋāϏāϏāĻš āĻāĻāĻāĻŋ āĻāϏāĻŋāĻā§āĻ āĻ
āĻŦāĻā§āĻā§āĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĻ `Promise{1}`, `Promise{2}`, `Promise{3}`āĨ¤ `gen` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻāĻŋ āĻāĻ āĻāϏāĻŋāĻā§āĻ āĻ
āĻŦāĻā§āĻā§āĻāĻŋāĻā§, āĻĒāϰāĻŦāϰā§āϤāĻŋāϤ⧠āϝā§āĻāĻžāϰ āĻāĻĒāϰ āĻāĻŽāϰāĻž `for await ... of` āϞā§āĻĒ āĻāĻžāϞāĻžāĻā§āĻāĻŋāĨ¤ āĻāĻāĻžāύ⧠`item` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻž āĻĒā§āϰāĻŽāĻŋāϏ āĻā§āϝāĻžāϞā§āĻā§āϞā§āĻā§āĻ ā§§āĻŽā§ `Promise{1}`, āĻĒāϰāĻŦāϰā§āϤāĻŋāϤ⧠`Promise{2}`, āĻĒāϰāĻŦāϰā§āϤāĻŋāϤ⧠`Promise{3}`āĨ¤ āϝā§āĻšā§āϤ⧠āĻāĻŽāϰāĻž `item` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞā§āϰ āĻāύā§āϝ _awaiting_ āĻāϰāĻāĻŋ, āϤāĻžāĻ āĻĒā§āϰāĻŽāĻŋāϏā§āϰ āϰāĻŋāϏāϞā§āĻāĻĄ _āĻā§āϝāĻžāϞā§āĻā§āϞā§āĻ_ āϰāĻŋāĻāĻžāϰā§āύ āĻšāĻā§āĻā§āĻ `1`, `2`, āĻ `3`āĨ¤
@@ -4086,7 +4088,7 @@ myFunc(1, 2, 3);
#### āĻāϤā§āϤāϰ: D
-`myFunc` expects an object with properties `x`, `y` and `z` as its argument. Since we're only passing three separate numeric values (1, 2, 3) instead of one object with properties `x`, `y` and `z` ({x: 1, y: 2, z: 3}), `x`, `y` and `z` have their default value of `undefined`.
+`myFunc` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻā§ āĻāĻļāĻž āĻāϰāĻā§ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻ āϝāĻžāϰ `x`, `y` āĻ `z` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻā§āϞ⧠āĻāĻā§āĨ¤ āϝā§āĻšā§āϤ⧠āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ `x`, `y` āĻ `z` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏāĻš āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻĒāϰāĻŋāĻŦāϰā§āϤ⧠({x: 1, y: 2, z: 3}) āĻāϞāĻžāĻĻāĻž āĻāϞāĻĻāĻž āϏāĻāĻā§āϝāĻžāϏā§āĻāĻ āĻā§āϝāĻžāϞ⧠(1, 2, 3) āĻĒāĻžāϏ āĻāϰāĻāĻŋ, `x`, `y` āĻ `z`āĻāϰ āĻā§āϝāĻžāϞā§āĻā§āϞ⧠āϤāĻžāĻĻā§āϰ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞ⧠`undefined`-āĻ āĻĨāĻžāĻāĻā§āĨ¤q
@@ -4097,14 +4099,14 @@ myFunc(1, 2, 3);
```javascript
function getFine(speed, amount) {
- const formattedSpeed = new Intl.NumberFormat('en-US', {
- style: 'unit',
- unit: 'mile-per-hour',
+ const formattedSpeed = new Intl.NumberFormat("en-US", {
+ style: "unit",
+ unit: "mile-per-hour",
}).format(speed);
- const formattedAmount = new Intl.NumberFormat('en-US', {
- style: 'currency',
- currency: 'USD',
+ const formattedAmount = new Intl.NumberFormat("en-US", {
+ style: "currency",
+ currency: "USD",
}).format(amount);
return `The driver drove ${formattedSpeed} and has to pay ${formattedAmount}`;
@@ -4123,7 +4125,7 @@ console.log(getFine(130, 300));
#### āĻāϤā§āϤāϰ: B
-With the `Intl.NumberFormat` method, we can format numeric values to any locale. We format the numeric value `130` to the `en-US` locale as a `unit` in `mile-per-hour`, which results in `130 mph`. The numeric value `300` to the `en-US` locale as a `currency` in `USD` results in `$300.00`.
+`Intl.NumberFormat` āĻŽā§āĻĨāĻĄ āĻŦā§āϝāĻžāĻŦāĻšāĻžāϰ āĻāϰ⧠āϏāĻāĻā§āϝāĻžāϏā§āĻāĻ āĻā§āϝāĻžāϞā§āĻā§ āĻā§āύ āĻāĻāĻāĻŋ āϞā§āĻāĻžāϞ⧠āĻĢāϰāĻŽā§āϝāĻžāĻ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻāĻŽāϰāĻž āϏāĻāĻā§āϝāĻžāϏā§āĻāĻ āĻā§āϝāĻžāϞ⧠`130` āĻā§ `unit` āĻšāĻŋāϏā§āĻŦā§ `mile-per-hour` āĻĻāĻŋā§ā§ `en-US` āϞā§āĻāĻžāϞ⧠āĻĢāϰāĻŽā§āϝāĻžāĻ āĻāϰā§āĻāĻŋ, āϝā§āĻāĻž āĻĢāϞāĻžāĻĢāϞ āĻĻāĻŋā§ā§āĻā§ `130 mph`āĨ¤ āĻāĻāĻāĻāĻžāĻŦā§ āϏāĻāĻā§āϝāĻžāϏā§āĻāĻ āĻā§āϝāĻžāϞ⧠`300` āĻā§ `currency` āĻšāĻŋāϏā§āĻŦā§ `USD` āĻĻāĻŋā§ā§ `en-US` āϞā§āĻāĻžāϞ⧠āĻĢāϰāĻŽā§āϝāĻžāĻ āĻāϰā§āĻāĻŋ āϝā§āĻāĻžāϰ āĻĢāϞāĻžāĻĢāϞ āĻšā§ `$300.00`āĨ¤
@@ -4133,8 +4135,8 @@ With the `Intl.NumberFormat` method, we can format numeric values to any locale.
###### 127. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const spookyItems = ['đģ', 'đ', 'đ¸'];
-({ item: spookyItems[3] } = { item: 'đ' });
+const spookyItems = ["đģ", "đ", "đ¸"];
+({ item: spookyItems[3] } = { item: "đ" });
console.log(spookyItems);
```
@@ -4149,7 +4151,7 @@ console.log(spookyItems);
#### āĻāϤā§āϤāϰ: B
-By destructuring objects, we can unpack values from the right-hand object, and assign the unpacked value to the value of the same property name on the left-hand object. In this case, we're assigning the value "đ" to `spookyItems[3]`. This means that we're modifying the `spookyItems` array, we're adding the "đ" to it. When logging `spookyItems`, `["đģ", "đ", "đ¸", "đ"]` gets logged.
+āĻ
āĻŦāĻā§āĻā§āĻ āĻĄāĻŋāϏā§āĻā§āϰāĻžāĻāĻāĻžāϰāĻŋāĻ ([āĻĄāĻŋāϏā§āĻā§āϰāĻžāĻāĻāĻžāϰāĻŋāĻ āĻ
ā§āϝāĻžāϏāĻžāĻāύāĻŽā§āύā§āĻ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)) āĻāϰ āĻŽāĻžāϧā§āϝāĻŽā§, āĻĄāĻžāύāĻĒāĻā§āώā§āϰ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻā§āϝāĻžāϞā§āĻā§āϞā§āĻā§ āĻŦā§āϰ āĻāϰ⧠āĻŦāĻžāĻŽāĻĒāĻā§āώā§āϰ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻāĻāĻ āύāĻžāĻŽā§āϰ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āĻĻāĻŋā§ā§ āĻ
ā§āϝāĻžāϏāĻžāĻāύ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻāĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž "đ" āĻā§āϝāĻžāϞā§āĻāĻŋāĻā§ `spookyItems[3]`-āϤ⧠āĻ
ā§āϝāĻžāϏāĻžāĻāύ āĻāϰāĻāĻŋāĨ¤ āĻāϰ āĻŽāĻžāύ⧠āĻšāϞā§, "đ" āĻā§āϝāĻžāϞā§āĻāĻŋāĻā§ āϝā§āĻā§āϤ āĻāϰ⧠āĻāĻŽāϰāĻž `spookyItems` āĻ
ā§āϝāĻžāϰā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§āĻāĻŋāĨ¤ āϤāĻžāĻ `spookyItems` āĻā§ āϞāĻ āĻāϰāĻžā§ `["đģ", "đ", "đ¸", "đ"]` āϞāĻ āĻšā§ā§āĻā§āĨ¤
@@ -4159,7 +4161,7 @@ By destructuring objects, we can unpack values from the right-hand object, and a
###### 128. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const name = 'Lydia Hallie';
+const name = "Lydia Hallie";
const age = 21;
console.log(Number.isNaN(name));
@@ -4179,9 +4181,9 @@ console.log(isNaN(age));
#### āĻāϤā§āϤāϰ: C
-With the `Number.isNaN` method, you can check if the value you pass is a _numeric value_ and equal to `NaN`. `name` is not a numeric value, so `Number.isNaN(name)` returns `false`. `age` is a numeric value, but is not equal to `NaN`, so `Number.isNaN(age)` returns `false`.
+`Number.isNaN` āĻŽā§āĻĨāĻĄā§āϰ āĻŽāĻžāϧā§āϝāĻŽā§, āĻāĻĒāύāĻŋ āĻā§āĻ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύ āϝ⧠āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻĒāύāĻŋ āĻĒāĻžāϏ āĻāϰāĻā§āύ āϏā§āĻāĻž _āϏāĻāĻā§āϝāĻžāϏā§āĻāĻ āĻā§āϝāĻžāϞā§_ āĻāĻŦāĻ _`NaN`_ āĻāϰ āϏāĻŽāĻžāύ āĻšāĻā§āĻā§ āĻāĻŋāύāĻžāĨ¤ `name` āϏāĻāĻā§āϝāĻžāϏā§āĻāĻ āĻā§āϝāĻžāϞ⧠āύā§, āϤāĻžāĻ `Number.isNaN(name)` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§ `false`āĨ¤ `age` āϏāĻāĻā§āϝāĻžāϏā§āĻāĻ āĻā§āϝāĻžāϞ⧠āĻāĻŋāύā§āϤ⧠`NaN` āĻāϰ āϏāĻŽāĻžāύ āύā§, āϤāĻžāĻ `Number.isNaN(age)` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§ `false`āĨ¤
-With the `isNaN` method, you can check if the value you pass is not a number. `name` is not a number, so `isNaN(name)` returns true. `age` is a number, so `isNaN(age)` returns `false`.
+āĻ
āύā§āϝāĻĻāĻŋāĻā§ `isNaN` āĻŽā§āĻĨāĻĄā§āϰ āĻŽāĻžāϧā§āϝāĻŽā§, āĻāĻĒāύāĻŋ āĻā§āĻŦāϞ āĻā§āĻ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύ āϝ⧠āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻĒāύāĻŋ āĻĒāĻžāϏ āĻāϰāĻā§āύ āϏā§āĻāĻž āĻā§āύ _āϏāĻāĻā§āϝāĻž āύā§_ āĻāĻŋāύāĻžāĨ¤ `name` āĻā§āύ āϏāĻāĻā§āϝāĻž āύā§, āϤāĻžāĻ `isNaN(name)` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§ `true`āĨ¤ `age` āĻāĻāĻāĻŋ āϏāĻāĻā§āϝāĻž, āϤāĻžāĻ `isNaN(age)` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§ `false`
@@ -4195,7 +4197,7 @@ const randomValue = 21;
function getInfo() {
console.log(typeof randomValue);
- const randomValue = 'Lydia Hallie';
+ const randomValue = "Lydia Hallie";
}
getInfo();
@@ -4211,7 +4213,9 @@ getInfo();
#### āĻāϤā§āϤāϰ: D
-Variables declared with the `const` keyword are not referenceable before their initialization: this is called the _temporal dead zone_. In the `getInfo` function, the variable `randomValue` is scoped in the functional scope of `getInfo`. On the line where we want to log the value of `typeof randomValue`, the variable `randomValue` isn't initialized yet: a `ReferenceError` gets thrown! The engine didn't go down the scope chain since we declared the variable `randomValue` in the `getInfo` function.
+`const` (āĻ `let`) āĻāĻŋāĻā§āĻžāϰā§āĻĄ āĻĻāĻŋā§ā§ āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰāĻž āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻā§āϞ⧠āϝ⧠āϞāĻžāĻāύ⧠āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ (āĻāύāĻŋāĻļāĻŋā§āĻžāϞāĻžāĻāĻ) āĻāϰāĻž āĻšā§ā§āĻā§ āϤāĻžāϰ āĻāĻā§ āĻāĻĻā§āϰāĻā§ āĻāĻā§āϏā§āϏ (āϰāĻŋāĻĄ/āϰāĻžāĻāĻ) āĻŦāĻž āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻāϰāĻž āϝāĻžā§ āύāĻžāĨ¤ āĻāĻāĻžāĻā§ **"āĻā§āĻŽā§āĻĒā§āϰāĻžāϞ āĻĄā§āĻĄ āĻā§āύ"** āĻŦāϞāĻž āĻšā§āĨ¤ āϤāĻžāĻ āĻā§āϰāĻŋā§ā§āĻŦāϞāĻā§ āĻāύāĻŋāĻļāĻŋā§āĻžāϞāĻžāĻāĻā§āĻļāύā§āϰ āĻāĻā§ āĻāĻā§āϏā§āϏ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻž āĻšāϞ⧠āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ `ReferenceError` āĻĻā§ā§āĨ¤
+
+`getInfo` āĻĢāĻžāĻāĻļāύā§āϰ `randomValue` āĻā§āϰāĻŋā§ā§āĻŦāϞāĻāĻŋāϰ āϏā§āĻā§āĻĒ āĻšāĻā§āĻā§ āϤāĻžāϰ āĻĢāĻžāĻāĻļāύāĻžāϞ āϏā§āĻā§āĻĒ - `getInfo`āĨ¤ āϝ⧠āϞāĻžāĻāύ⧠āĻāĻŽāϰāĻž `typeof randomValue` āĻāϰ āĻā§āϝāĻžāϞā§āĻā§ āϞāĻ āĻāϰāĻāĻŋ, āϤāĻāύ⧠`randomValue` āĻāύāĻŋāĻļāĻŋā§āĻžāϞāĻžāĻāĻ āĻšā§āύāĻŋāĻ āĻāĻāĻāĻŋ `ReferenceError` āĻšāĻā§āĻā§! āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻāĻā§āĻāĻŋāύ āϏā§āĻā§āĻĒ āĻā§āĻāύ⧠āĻā§āĻāĻā§ āĻĻā§āĻāĻā§ āύāĻž āϝā§āĻšā§āϤ⧠āĻāĻŽāϰāĻž `randomValue` āĻā§āϰāĻŋā§ā§āĻŦāϞāĻāĻŋāĻā§ `getInfo` āĻĢāĻžāĻāĻļāύā§āĻ āĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ āĻāϰā§āĻāĻŋāĨ¤
@@ -4221,7 +4225,7 @@ Variables declared with the `const` keyword are not referenceable before their i
###### 130. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const myPromise = Promise.resolve('Woah some cool data');
+const myPromise = Promise.resolve("Woah some cool data");
(async () => {
try {
@@ -4229,7 +4233,7 @@ const myPromise = Promise.resolve('Woah some cool data');
} catch {
throw new Error(`Oops didn't work`);
} finally {
- console.log('Oh finally!');
+ console.log("Oh finally!");
}
})();
```
@@ -4244,7 +4248,7 @@ const myPromise = Promise.resolve('Woah some cool data');
#### āĻāϤā§āϤāϰ: C
-In the `try` block, we're logging the awaited value of the `myPromise` variable: `"Woah some cool data"`. Since no errors were thrown in the `try` block, the code in the `catch` block doesn't run. The code in the `finally` block _always_ runs, `"Oh finally!"` gets logged.
+`try` āĻŦā§āϞāĻā§, āĻāĻŽāϰāĻž `myPromise` āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞā§āϰ āĻ
āĻĒā§āĻā§āώāĻŋāϤ āĻā§āϝāĻžāϞā§āĻāĻŋ āϞāĻ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻāĻŋ: `"Woah some cool data"`āĨ¤ āϝā§āĻšā§āϤ⧠`try` āĻŦā§āϞāĻā§ āĻā§āύ⧠āĻāϰāϰ āĻĨā§āϰ⧠āĻšāϝāĻŧāύāĻŋ, `catch` āĻŦā§āϞāĻā§āϰ āĻā§āĻĄ āϰāĻžāύ āĻšāϝāĻŧ āύāĻžāĨ¤ `finally` āĻŦā§āϞāĻā§āϰ āĻā§āĻĄ _āϏāĻŦāϏāĻŽāϝāĻŧāĻ_ āϰāĻžāύ āĻšāϝāĻŧ, āϤāĻžāĻ `"Oh finally!"` āϞāĻ āĻšāϝāĻŧāĨ¤
@@ -4254,7 +4258,7 @@ In the `try` block, we're logging the awaited value of the `myPromise` variable:
###### 131. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const emojis = ['đĨ', ['â¨', 'â¨', ['đ', 'đ']]];
+const emojis = ["đĨ", ["â¨", "â¨", ["đ", "đ"]]];
console.log(emojis.flat(1));
```
@@ -4269,7 +4273,7 @@ console.log(emojis.flat(1));
#### āĻāϤā§āϤāϰ: B
-With the `flat` method, we can create a new, flattened array. The depth of the flattened array depends on the value that we pass. In this case, we passed the value `1` (which we didn't have to, that's the default value), meaning that only the arrays on the first depth will be concatenated. `['đĨ']` and `['â¨', 'â¨', ['đ', 'đ']]` in this case. Concatenating these two arrays results in `['đĨ', 'â¨', 'â¨', ['đ', 'đ']]`.
+`flat` āĻĒāĻĻā§āϧāϤāĻŋāϰ āϏāĻžāĻšāĻžāϝā§āϝā§, āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ āύāϤā§āύ, āϏāĻŽāϤāϞāĻā§āϤ āĻ
ā§āϝāĻžāϰ⧠āϤā§āϰāĻŋ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āϏāĻŽāϤāϞāĻā§āϤ āĻ
ā§āϝāĻžāϰā§āϰ āĻāĻā§āϰāϤāĻž āύāĻŋāϰā§āĻāϰ āĻāϰ⧠āϝ⧠āĻŽāĻžāύāĻāĻŋ āĻāĻŽāϰāĻž āĻĒāĻžāϏ āĻāϰāĻŋ āϤāĻžāϰ āĻāĻĒāϰāĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž āĻŽāĻžāύ `1` āĻĒāĻžāϏ āĻāϰā§āĻāĻŋ (āϝāĻž āĻāĻŽāĻžāĻĻā§āϰ āĻĒāĻžāϏ āύāĻž āĻāϰāϞā§āĻ āĻšāϤ, āĻāĻāĻŋ āĻĄāĻŋāĻĢāϞā§āĻ āĻŽāĻžāύ), āĻāϰ āĻ
āϰā§āĻĨ āĻšāϞ āĻā§āĻŦāϞāĻŽāĻžāϤā§āϰ āĻĒā§āϰāĻĨāĻŽ āϏā§āϤāϰā§āϰ āĻ
ā§āϝāĻžāϰā§āĻā§āϞāĻŋ āϏāĻāϝā§āĻā§āϤ āĻšāĻŦā§āĨ¤ āĻāĻ āĻā§āώā§āϤā§āϰ⧠`['đĨ']` āĻāĻŦāĻ `['â¨', 'â¨', ['đ', 'đ']]`āĨ¤ āĻāĻ āĻĻā§āĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āϏāĻāϝā§āĻā§āϤ āĻāϰāĻžāϰ āĻĢāϞ⧠`['đĨ', 'â¨', 'â¨', ['đ', 'đ']]` āĻĒāĻžāĻāϝāĻŧāĻž āϝāĻžāϝāĻŧāĨ¤
@@ -4309,13 +4313,13 @@ console.log(counterOne.count);
#### āĻāϤā§āϤāϰ: D
-`counterOne` is an instance of the `Counter` class. The counter class contains a `count` property on its constructor, and an `increment` method. First, we invoked the `increment` method twice by calling `counterOne.increment()`. Currently, `counterOne.count` is `2`.
+`counterOne` āĻšāϞ `Counter` āĻā§āϞāĻžāϏā§āϰ āĻāĻāĻāĻŋ āĻāύāϏā§āĻā§āϝāĻžāύā§āϏāĨ¤ `Counter` āĻā§āϞāĻžāϏā§āϰ āĻāύāϏā§āĻā§āϰāĻžāĻā§āĻāϰ⧠āĻāĻāĻāĻŋ `count` āĻĒā§āϰāĻĒāĻžāϰā§āĻāĻŋ āĻāĻŦāĻ āĻāĻāĻāĻŋ `increment` āĻŽā§āĻĨāĻĄ āϰāϝāĻŧā§āĻā§āĨ¤ āĻĒā§āϰāĻĨāĻŽā§, āĻāĻŽāϰāĻž `counterOne.increment()` āĻāϞ āĻāϰ⧠`increment` āĻŽā§āĻĨāĻĄ āĻĻā§'āĻŦāĻžāϰ āĻāϞ āĻāϰā§āĻāĻŋāĨ¤ āĻŦāϰā§āϤāĻŽāĻžāύā§, `counterOne.count` āĻšāϞ `2`āĨ¤
-Then, we create a new variable `counterTwo`, and set it equal to `counterOne`. Since objects interact by reference, we're just creating a new reference to the same spot in memory that `counterOne` points to. Since it has the same spot in memory, any changes made to the object that `counterTwo` has a reference to, also apply to `counterOne`. Currently, `counterTwo.count` is `2`.
+āϤāĻžāϰāĻĒāϰ, āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ āύāϤā§āύ āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ `counterTwo` āϤā§āϰāĻŋ āĻāϰāĻŋ āĻāĻŦāĻ āĻāĻāĻŋāĻā§ `counterOne` āĻāϰ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻŋāĨ¤ āϝā§āĻšā§āϤ⧠āĻ
āĻŦāĻā§āĻā§āĻāĻā§āϞāĻŋ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻĻā§āĻŦāĻžāϰāĻž āĻāύā§āĻāĻžāϰāĻ
ā§āϝāĻžāĻā§āĻ āĻāϰā§, āĻāĻŽāϰāĻž āĻā§āĻŦāϞ `counterOne` āϝ⧠āĻŽā§āĻŽāϰāĻŋāϰ āϞā§āĻā§āĻļāύ⧠āύāĻŋāϰā§āĻĻā§āĻļ āĻāϰ⧠āϤāĻžāϰ āĻāĻāĻāĻŋ āύāϤā§āύ āϰā§āĻĢāĻžāϰā§āύā§āϏ āϤā§āϰāĻŋ āĻāϰāĻāĻŋāĨ¤ āϝā§āĻšā§āϤ⧠āĻāĻāĻŋ āĻāĻāĻ āĻŽā§āĻŽāϰāĻŋ āϞā§āĻā§āĻļāύ⧠āύāĻŋāϰā§āĻĻā§āĻļ āĻāϰā§, āϤāĻžāĻ `counterTwo` āϝā§āĻ āĻ
āĻŦāĻā§āĻā§āĻāĻāĻŋāϰ āϰā§āĻĢāĻžāϰā§āύā§āϏ āĻĻā§āϝāĻŧ āϤāĻžāϤ⧠āĻāϰāĻž āϝā§āĻā§āύ⧠āĻĒāϰāĻŋāĻŦāϰā§āϤāύ `counterOne` āĻāϰ āĻā§āώā§āϤā§āϰā§āĻ āĻĒā§āϰāϝā§āĻā§āϝ āĻšāĻŦā§āĨ¤ āĻŦāϰā§āϤāĻŽāĻžāύā§, `counterTwo.count` āĻšāϞ `2`āĨ¤
-We invoke `counterTwo.increment()`, which sets `count` to `3`. Then, we log the count on `counterOne`, which logs `3`.
+āĻāĻŽāϰāĻž `counterTwo.increment()` āĻāϞ āĻāϰāĻŋ, āϝāĻž `count` āĻā§ āϏā§āĻ āĻāϰ⧠`3`āĨ¤ āϤāĻžāϰāĻĒāϰ, āĻāĻŽāϰāĻž `counterOne` āĻāϰ `count` āϞāĻ āĻāϰāĻŋ, āϝāĻž āϞāĻ āĻāϰ⧠`3`āĨ¤
@@ -4327,19 +4331,19 @@ We invoke `counterTwo.increment()`, which sets `count` to `3`. Then, we log the
###### 133. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const myPromise = Promise.resolve(Promise.resolve('Promise'));
+const myPromise = Promise.resolve(Promise.resolve("Promise"));
function funcOne() {
- setTimeout(() => console.log('Timeout 1!'), 0);
+ setTimeout(() => console.log("Timeout 1!"), 0);
myPromise.then((res) => res).then((res) => console.log(`${res} 1!`));
- console.log('Last line 1!');
+ console.log("Last line 1!");
}
async function funcTwo() {
const res = await myPromise;
console.log(`${res} 2!`);
- setTimeout(() => console.log('Timeout 2!'), 0);
- console.log('Last line 2!');
+ setTimeout(() => console.log("Timeout 2!"), 0);
+ console.log("Last line 2!");
}
funcOne();
@@ -4356,19 +4360,19 @@ funcTwo();
#### āĻāϤā§āϤāϰ: C
-First, we invoke `funcOne`. On the first line of `funcOne`, we call the _asynchronous_ `setTimeout` function, from which the callback is sent to the Web API. (see my article on the event loop here.)
+āĻĒā§āϰāĻĨāĻŽā§, āĻāĻŽāϰāĻž `funcOne` āĻĢāĻžāĻāĻļāύ āĻāĻžāϞāĻŋā§ā§āĻāĻŋāĨ¤ `funcOne` āĻāϰ ā§§āĻŽ āϞāĻžāĻāύ⧠āĻāĻŽāϰāĻž _āĻ
ā§āϝāĻžāϏāĻŋāĻā§āĻā§āϰā§āύāĻžāϏ_ `setTimeout` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāϞ āĻāϰāĻāĻŋ, āϝā§āĻāĻžāύ āĻĨā§āĻā§ āĻāϞāĻŦā§āϝāĻžāĻāĻāĻŋ Web API āĻ āĻĒāĻžāĻ āĻžāύ⧠āĻšā§ā§āĻā§āĨ¤ (āĻāĻā§āύā§āĻ āϞā§āĻĒā§āϰ āĻāϰā§āĻāĻŋāĻā§āϝāĻžāϞāĻāĻŋ āĻĒā§ā§āύ āĻāĻāĻžāύ āĻĨā§āĻā§.)
-Then we call the `myPromise` promise, which is an _asynchronous_ operation. Pay attention, that now only the first then clause was added to the microtask queue.
+āĻĒāϰāĻŦāϰā§āϤāĻŋāϤ⧠āĻāĻŽāϰāĻž `myPromise` āĻĒā§āϰāĻŽāĻŋāϏāĻāĻŋ āĻāϞ āĻāϰā§āĻāĻŋ āϝā§āĻāĻž _āĻ
ā§āϝāĻžāϏāĻŋāĻā§āĻā§āϰā§āύāĻžāϏ_ āĻ
āĻĒāĻžāϰā§āĻļāύāĨ¤ āĻŽāύā§āϝā§āĻ āĻĻāĻŋāύ, āĻāĻāύ āĻā§āĻŦāϞ `.then()` āĻā§āĻāύā§āϰ ā§§āĻŽ āĻ
āĻāĻļāĻāĻŋ āĻŽāĻžāĻāĻā§āϰā§āĻāĻžāϏā§āĻ āĻāĻŋāĻāϤ⧠āϝā§āĻā§āϤ āĻšā§ā§āĻā§āĨ¤
-Both the promise and the timeout are asynchronous operations, the function keeps on running while it's busy completing the promise and handling the `setTimeout` callback. This means that `Last line 1!` gets logged first, since this is not an asynchonous operation.
+āĻĒā§āϰāĻŽāĻŋāϏ āĻ āĻāĻžāĻāĻŽ-āĻāĻāĻ āĻĻā§āĻā§āĻ _āĻ
ā§āϝāĻžāϏāĻŋāĻā§āĻā§āϰā§āύāĻžāϏ_ āĻ
āĻĒāĻžāϰā§āĻļāύ, āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāϞāϤā§āĻ āĻĨāĻžāĻā§ āϝāĻāύ āϏ⧠āĻĒā§āϰāĻŽāĻŋāϏ āϏāĻŽāĻžāϧāĻžāύ āĻāĻŦāĻ āĻāĻžāĻāĻŽ-āĻāĻāĻ āĻāϞāĻŦā§āϝāĻžāĻ āĻšā§āϝāĻžāύā§āĻĄā§āϞ āĻāϰāϤ⧠āĻĨāĻžāĻā§āĨ¤ āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ⧠`Last line 1!` āϞāĻ āĻšāĻā§āĻā§ āĻĒā§āϰāĻĨāĻŽā§, āϝā§āĻšā§āϤ⧠āĻāĻāĻž āĻā§āύ _āĻ
ā§āϝāĻžāϏāĻŋāĻā§āĻā§āϰā§āύāĻžāϏ_ āĻ
āĻĒāĻžāϰā§āĻļāύ āύā§āĨ¤
-Since the callstack is not empty yet, the `setTimeout` function and promise in `funcOne` cannot get added to the callstack yet.
+āϝā§āĻšā§āϤ⧠āĻāϞāϏā§āĻā§āϝāĻžāĻ āĻāĻāύ⧠āĻāĻžāϞāĻŋ āύ⧠āϤāĻžāĻ `funcOne` āĻāϰ `setTimeout` āĻĢāĻžāĻāĻļāύ āĻ `myPromise` āĻĒā§āϰāĻŽāĻŋāϏ āϤāĻāύ⧠āĻāϞāϏā§āĻā§āϝāĻžāĻ āĻ āĻāϏāϤ⧠āĻĒāĻžāϰ⧠āύāĻžāĨ¤
-In `funcTwo`, the variable `res` gets `Promise` because `Promise.resolve(Promise.resolve('Promise'))` is equivalent to `Promise.resolve('Promise')` since resolving a promise just resolves it's value. The `await` in this line stops the execution of the function until it receives the resolution of the promise and then keeps on running synchronously until completion, so `Promise 2!` and then `Last line 2!` are logged and the `setTimeout` is sent to the Web API. If the first then clause in `funcOne` had its own log statement, it would be printed before `Promise 2!`. Howewer, it executed silently and put the second then clause in microtask queue. So, the second clause will be printed after `Promise 2!`.
+`funcTwo` āĻ, `res` āĻā§āĻžāϰā§ā§ā§āĻŦāϞāĻāĻŋ āĻāĻāĻāĻŋ `Promise` āĻĒāĻžāĻā§āĻā§ āĻāĻžāϰāύ `Promise.resolve(Promise.resolve('Promise'))` āĻāϰ āϏāĻŽāĻŽāĻžāύ āĻšāϞ⧠`Promise.resolve('Promise')` āϝā§āĻšā§āϤ⧠āĻāĻāĻāĻŋ āĻĒā§āϰāĻŽāĻŋāϏ āϏāĻŽāĻžāϧāĻžāύ āĻāϰāĻž āĻŽāĻžāύ⧠āĻšāϞ⧠āĻāϰ āĻā§āϝāĻžāϞā§āĻāĻŋāĻā§āĻ āϏāĻŽāĻžāϧāĻžāύ āĻāϰāĻžāĨ¤ `await` āĻāϰ āĻāύā§āϝ āĻāĻ āϞāĻžāĻāύ⧠āĻĢāĻžāĻāĻļāύāĻāĻŋāϰ āĻāĻā§āϏāĻŋāĻāĻŋāĻāĻļāύ āĻĨā§āĻŽā§ āĻĨāĻžāĻāĻŦā§ āϝāϤāĻā§āώāĻŖ āĻĒāϰā§āϝāύā§āϤ āύāĻž āϏ⧠āĻĒā§āϰāĻŽāĻŋāϏ āϏāĻŽāĻžāϧāĻžāύ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāĻā§āĻā§ āĻāĻŦāĻ āϏāĻŋāĻā§āĻā§āϰāύāĻžāϏāĻāĻžāĻŦā§ āĻļā§āώ āĻšāĻā§āĻž āĻĒāϰā§āϝāύā§āϤ āĻāϞāϤ⧠āĻĨāĻžāĻā§, āϤāĻžāĻ `Promise 2!` āĻ āĻāϰ āĻĒāϰ⧠`Last line 2!` āϞāĻ āĻšā§ āĻāĻŦāĻ `setTimeout` Web API āĻā§ āĻĒāĻžāĻ āĻžāύ⧠āĻšā§āĨ¤ āϝāĻĻāĻŋ `funcOne` āĻĢāĻžāĻāĻļāύ⧠`.then()` āĻāϰ ā§§āĻŽ āĻ
āĻāĻļ āύāĻŋāĻā§āϰ āĻā§āύ āϞāĻ āϏā§āĻā§āĻāĻŽā§āύā§āĻ āĻĨāĻžāĻāϤ, āϏā§āĻāĻž `Promise 2!` āĻāϰ āĻāĻā§ āĻĒā§āϰāĻŋāύā§āĻ āĻšāϤāĨ¤ āϝāĻžāĻ āĻšā§āĻ, āĻāĻāĻž āĻā§āĻĒāĻāĻžāĻĒ āĻāĻā§āϏāĻŋāĻāĻŋāĻāĻ āĻšā§ āĻāĻŦāĻ `.then()` āĻāϰ ⧍⧠āĻ
āĻāĻļāĻā§ āĻŽāĻžāĻāĻā§āϰā§āĻāĻžāϏā§āĻ āĻāĻŋāĻāϤ⧠āĻĒāĻžāĻ āĻŋā§ā§ āĻĻā§ā§āĨ¤ āϤāĻžāĻ, ⧍⧠āĻ
āĻāĻļāĻāĻŋ `Promise 2!` āĻāϰ āĻĒāϰā§āĻ āĻĒā§āϰāĻŋāύā§āĻ āĻšāĻŦā§āĨ¤
-Then the call stack is empty. Promises are _microtasks_ so they are resolved first when the call stack is empty so `Promise 1!` gets to be logged.
+āĻĒāϰā§āϰ āϧāĻžāĻĒā§, āĻāϞ āϏā§āĻā§āϝāĻžāĻ āĻāĻžāϞāĻŋāĨ¤ āĻĒā§āϰāĻŽāĻŋāϏāĻā§āϞ⧠_āĻŽāĻžāĻāĻā§āϰā§āĻāĻžāϏā§āĻ_ āĻĢāϞ⧠āϤāĻžāĻāϰāĻž āĻĒā§āϰāĻĨāĻŽā§ āϰāĻŋāϏāϞāĻ āĻšāĻŦā§ āϝāĻāύ āĻāϞ āϏā§āĻā§āϝāĻžāĻ āĻāĻžāϞāĻŋ āĻĨāĻžāĻāĻŦā§ āϤāĻžāĻ `Promise 1!` āϞāĻ āĻšā§ā§āĻā§āĨ¤
-Now, since `funcTwo` popped off the call stack, the call stack is empty. The callbacks waiting in the queue (`() => console.log("Timeout 1!")` from `funcOne`, and `() => console.log("Timeout 2!")` from `funcTwo`) get added to the call stack one by one. The first callback logs `Timeout 1!`, and gets popped off the stack. Then, the second callback logs `Timeout 2!`, and gets popped off the stack.
+āĻāĻāύ āϝā§āĻšāϤ⧠`funcTwo` āĻāϞ āϏā§āĻā§āϝāĻžāĻ āĻĨā§āĻā§ āϰā§āĻŦ āĻšā§ā§ āϝāĻžā§, āĻāϞ āϏā§āĻā§āϝāĻžāĻ āĻāĻžāϞāĻŋ āĻĨāĻžāĻāĻā§āĨ¤ āĻāĻŋāĻāϤ⧠āϝ⧠āĻāϞāĻŦā§āϝāĻžāĻāĻā§āϞāĻŋ āĻ
āĻĒā§āĻā§āώāĻž āĻāϰāĻā§ (`funcOne` āĻāϰ - `() => console.log("Timeout 1!")` āĻāĻŦāĻ `funcTwo` āĻāϰ `() => console.log("Timeout 2!")`) āϤāĻžāϰāĻž āĻāĻā§āϰ āĻĒāϰ āĻāĻ āĻāϞ āϏā§āĻā§āϝāĻžāĻ āĻ āϝā§āĻā§āϤ āĻšā§āĨ¤ ā§§āĻŽ āĻāϞāĻŦā§āϝāĻžāĻ āϞāĻ āĻāϰ⧠`Timeout 1!`, āĻāĻŦāĻ āĻāϞ āϏā§āĻā§āϝāĻžāĻ āĻĨā§āĻā§ āϰā§āĻŦ āĻšā§ā§ āϝāĻžā§āĨ¤ āĻāϰāĻĒāϰ, ⧍⧠āĻāϞāĻŦā§āϝāĻžāĻ āϞāĻ āĻāϰ⧠`Timeout 2!`, āĻāĻŦāĻ āĻāϞ āϏā§āĻā§āϝāĻžāĻ āĻĨā§āĻā§ āϰā§āĻŦ āĻšā§ā§ āϝāĻžā§āĨ¤
@@ -4384,7 +4388,7 @@ export default function sum(x) {
}
// index.js
-import * as sum from './sum';
+import * as sum from "./sum";
```
- A: `sum(4)`
@@ -4401,12 +4405,12 @@ With the asterisk `*`, we import all exported values from that file, both defaul
```javascript
// info.js
-export const name = 'Lydia';
+export const name = "Lydia";
export const age = 21;
-export default 'I love JavaScript';
+export default "I love JavaScript";
// index.js
-import * as info from './info';
+import * as info from "./info";
console.log(info);
```
@@ -4437,13 +4441,13 @@ We can invoke this function, by calling `sum.default`
```javascript
const handler = {
- set: () => console.log('Added a new property!'),
- get: () => console.log('Accessed a property!'),
+ set: () => console.log("Added a new property!"),
+ get: () => console.log("Accessed a property!"),
};
const person = new Proxy({}, handler);
-person.name = 'Lydia';
+person.name = "Lydia";
person.name;
```
@@ -4473,7 +4477,7 @@ Then, we access a property value on the proxy object, and the `get` property on
###### 136. Which of the following will modify the `person` object?
```javascript
-const person = { name: 'Lydia Hallie' };
+const person = { name: "Lydia Hallie" };
Object.seal(person);
```
@@ -4501,9 +4505,9 @@ However, you can still modify the value of existing properties.
```javascript
const person = {
- name: 'Lydia Hallie',
+ name: "Lydia Hallie",
address: {
- street: '100 Main St',
+ street: "100 Main St",
},
};
@@ -4603,8 +4607,8 @@ In ES2020, we can add private variables in classes by using the `#`. We cannot a
```javascript
const teams = [
- { name: 'Team 1', members: ['Paul', 'Lisa'] },
- { name: 'Team 2', members: ['Laura', 'Tim'] },
+ { name: "Team 1", members: ["Paul", "Lisa"] },
+ { name: "Team 2", members: ["Laura", "Tim"] },
];
function* getMembers(members) {
@@ -4647,8 +4651,8 @@ If we would've written `yield`, `return yield`, or `return`, the entire generato
```javascript
const person = {
- name: 'Lydia Hallie',
- hobbies: ['coding'],
+ name: "Lydia Hallie",
+ hobbies: ["coding"],
};
function addHobby(hobby, hobbies = person.hobbies) {
@@ -4656,9 +4660,9 @@ function addHobby(hobby, hobbies = person.hobbies) {
return hobbies;
}
-addHobby('running', []);
-addHobby('dancing');
-addHobby('baking', person.hobbies);
+addHobby("running", []);
+addHobby("dancing");
+addHobby("baking", person.hobbies);
console.log(person.hobbies);
```
@@ -4727,11 +4731,11 @@ We create the variable `pet` which is an instance of the `Flamingo` class. When
###### 143. Which of the options result(s) in an error?
```javascript
-const emojis = ['đ', 'đ
đŧ', 'đ', 'â'];
+const emojis = ["đ", "đ
đŧ", "đ", "â"];
-/* 1 */ emojis.push('đĻ');
+/* 1 */ emojis.push("đĻ");
/* 2 */ emojis.splice(0, 2);
-/* 3 */ emojis = [...emojis, 'đĨ'];
+/* 3 */ emojis = [...emojis, "đĨ"];
/* 4 */ emojis.length = 0;
```
@@ -4817,9 +4821,9 @@ function getFruit(fruits) {
console.log(fruits?.[1]?.[1]);
}
-getFruit([['đ', 'đ'], ['đ']]);
+getFruit([["đ", "đ"], ["đ"]]);
getFruit();
-getFruit([['đ'], ['đ', 'đ']]);
+getFruit([["đ"], ["đ", "đ"]]);
```
- A: `null`, `undefined`, đ
@@ -4885,8 +4889,8 @@ We set the variable `calc` equal to a new instance of the `Calc` class. Then, we
```javascript
const user = {
- email: 'e@mail.com',
- password: '12345',
+ email: "e@mail.com",
+ password: "12345",
};
const updateUser = ({ email, password }) => {
@@ -4901,7 +4905,7 @@ const updateUser = ({ email, password }) => {
return user;
};
-const updatedUser = updateUser({ email: 'new@email.com' });
+const updatedUser = updateUser({ email: "new@email.com" });
console.log(updatedUser === user);
```
@@ -4926,11 +4930,11 @@ The `updateUser` function updates the values of the `email` and `password` prope
###### 149. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const fruit = ['đ', 'đ', 'đ'];
+const fruit = ["đ", "đ", "đ"];
fruit.slice(0, 1);
fruit.splice(0, 1);
-fruit.unshift('đ');
+fruit.unshift("đ");
console.log(fruit);
```
@@ -4958,11 +4962,11 @@ At last, we invoke the `unshift` method on the `fruit` array, which modifies the
```javascript
const animals = {};
-let dog = { emoji: 'đļ' };
-let cat = { emoji: 'đ' };
+let dog = { emoji: "đļ" };
+let cat = { emoji: "đ" };
-animals[dog] = { ...dog, name: 'Mara' };
-animals[cat] = { ...cat, name: 'Sara' };
+animals[dog] = { ...dog, name: "Mara" };
+animals[cat] = { ...cat, name: "Sara" };
console.log(animals[dog]);
```
@@ -4994,13 +4998,13 @@ Logging `animals[dog]`, or actually `animals["[object Object]"]` since convertin
```javascript
const user = {
- email: 'my@email.com',
+ email: "my@email.com",
updateEmail: (email) => {
this.email = email;
},
};
-user.updateEmail('new@email.com');
+user.updateEmail("new@email.com");
console.log(user.email);
```
@@ -5024,10 +5028,10 @@ The `updateEmail` function is an arrow function, and is not bound to the `user`
###### 152. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-const promise1 = Promise.resolve('First');
-const promise2 = Promise.resolve('Second');
-const promise3 = Promise.reject('Third');
-const promise4 = Promise.resolve('Fourth');
+const promise1 = Promise.resolve("First");
+const promise2 = Promise.resolve("Second");
+const promise3 = Promise.reject("Third");
+const promise4 = Promise.resolve("Fourth");
const runPromises = async () => {
const res1 = await Promise.all([promise1, promise2]);
@@ -5060,8 +5064,8 @@ The `Promise.all` method runs the passed promises in parallel. If one promise fa
###### 153. What should the value of `method` be to log `{ name: "Lydia", age: 22 }`?
```javascript
-const keys = ['name', 'age'];
-const values = ['Lydia', 22];
+const keys = ["name", "age"];
+const values = ["Lydia", 22];
const method =
/* ?? */
@@ -5096,7 +5100,7 @@ This creates an array of subarrays containing the correct keys and values, which
```javascript
const createMember = ({ email, address = {} }) => {
const validEmail = /.+\@.+\..+/.test(email);
- if (!validEmail) throw new Error('Valid email pls');
+ if (!validEmail) throw new Error("Valid email pls");
return {
email,
@@ -5104,7 +5108,7 @@ const createMember = ({ email, address = {} }) => {
};
};
-const member = createMember({ email: 'my@email.com' });
+const member = createMember({ email: "my@email.com" });
console.log(member);
```
@@ -5128,10 +5132,10 @@ The default value of `address` is an empty object `{}`. When we set the variable
###### 155. āĻāĻāĻžāϰ āĻāĻāĻāĻĒā§āĻ āĻā§āύāĻāĻž?
```javascript
-let randomValue = { name: 'Lydia' };
+let randomValue = { name: "Lydia" };
randomValue = 23;
-if (!typeof randomValue === 'string') {
+if (!typeof randomValue === "string") {
console.log("It's not a string!");
} else {
console.log("Yay it's a string!");
From fe2dddb69328d08555952d4cbeb765ebb65a8237 Mon Sep 17 00:00:00 2001
From: iamsaief
Date: Tue, 23 Jul 2024 02:43:11 +0600
Subject: [PATCH 11/12] added translation till 150
---
bn-BD/README_bn-BD.md | 92 +++++++++++++++++++++----------------------
1 file changed, 46 insertions(+), 46 deletions(-)
diff --git a/bn-BD/README_bn-BD.md b/bn-BD/README_bn-BD.md
index af201342..4ac18dad 100644
--- a/bn-BD/README_bn-BD.md
+++ b/bn-BD/README_bn-BD.md
@@ -4379,7 +4379,7 @@ funcTwo();
---
-###### 134. How can we invoke `sum` in `sum.js` from `index.js?`
+###### 134. āĻāĻŋāĻāĻžāĻŦā§ āĻāĻŽāϰāĻž `sum.js` āĻāϰ `sum` āĻā§ `index.js` āĻĨā§āĻā§ āĻāϞ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ?
```javascript
// sum.js
@@ -4401,7 +4401,7 @@ import * as sum from "./sum";
#### āĻāϤā§āϤāϰ: C
-With the asterisk `*`, we import all exported values from that file, both default and named. If we had the following file:
+āĻāĻāĻžāύ⧠āĻāϏā§āĻā§āϰāĻŋāϏā§āĻ `*` āĻĻāĻŋā§ā§, āĻāĻŽāϰāĻž āĻāĻ āĻĢāĻžāĻāϞā§āϰ āϏāĻāϞ āĻāĻā§āϏāĻĒā§āϰā§āĻ āĻā§āϝāĻžāϞā§āĻā§āϞā§āĻā§ āĻāĻŽā§āĻĒā§āϰā§āĻ āĻāϰā§āĻāĻŋ, _āĻĄāĻŋāĻĢāϞā§āĻ_ āĻ _āύā§āĻŽāĻĄ_ āĻĻā§āĻā§āĻāĨ¤ āϝāĻĻāĻŋ āĻāĻŽāĻžāĻĻā§āϰ āύāĻŋāĻā§ āĻāϞā§āϞā§āĻāĻŋāϤ āĻĢāĻžāĻāϞ āĻĨāĻžāĻāϤāĻ
```javascript
// info.js
@@ -4414,7 +4414,7 @@ import * as info from "./info";
console.log(info);
```
-The following would get logged:
+āϤāĻŦā§ āύāĻŋāĻā§ āĻāϞā§āϞā§āĻāĻŋāϤāĻāĻžāĻŦā§ āϞāĻ āĻšāϤāĻ
```javascript
{
@@ -4424,13 +4424,13 @@ The following would get logged:
}
```
-For the `sum` example, it means that the imported value `sum` looks like this:
+`sum` āĻāĻĻāĻžāĻšāϰāĻŖā§āϰ āĻŦā§āϞāĻžā§, āĻāĻāĻž āĻŦā§āĻāĻžā§ āϝ⧠āĻāĻŽā§āĻĒā§āϰā§āĻ āĻāϰāĻž `sum` āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāϰāĻāĻŽ āĻĻā§āĻāĻžāĻŦā§āĻ
```javascript
{ default: function sum(x) { return x + x } }
```
-We can invoke this function, by calling `sum.default`
+āĻāĻŽāϰāĻž āĻāĻ āĻĢāĻžāύāĻāĻļāύāĻāĻŋāĻā§ āĻāĻžāϞāĻžāϤ⧠āĻĒāĻžāϰāĻŋ, `sum.default` āĻāϞ āĻāϰāĻžāϰ āĻŽāĻžāϧā§āϝāĻŽā§āĨ¤
@@ -4461,20 +4461,20 @@ person.name;
#### āĻāϤā§āϤāϰ: C
-With a Proxy object, we can add custom behavior to an object that we pass to it as the second argument. In this case, we pass the `handler` object which contains two properties: `set` and `get`. `set` gets invoked whenever we _set_ property values, and `get` gets invoked whenever we _get_ (access) property values.
+Proxy āĻ
āĻŦāĻā§āĻā§āĻ āĻĻāĻŋā§ā§, āĻāĻŽāϰāĻž āĻā§āύ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§ āĻāĻžāϏā§āĻāĻŽ āĻ
āĻāĻžāϰāύ āϝā§āĻā§āϤ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ āϝā§āĻāĻžāĻ⧠⧍⧠āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻšāĻŋāϏā§āĻŦā§ āĻĒāĻžāϏ āĻāϰāĻŋāĨ¤ āĻāĻā§āώā§āϤā§āϰā§, `handler` āĻ
āĻŦāĻā§āĻā§āĻ āĻĒāĻžāϏ āĻāϰā§āĻāĻŋ āϝā§āĻāĻžā§ āĻĻā§āĻāĻŋ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏ āĻāĻā§āĻ `set` āĻāĻŦāĻ `get`āĨ¤ `set` āĻāϞ āĻšā§ āϝāĻāύāĻŋ āĻāĻŽāϰāĻž āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠_āϏā§āĻ_ āĻāϰāĻŋ, āĻāĻŦāĻ `get` āĻāϞ āĻšā§ āϝāĻāύāĻŋ āĻāĻŽāϰāĻž āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠_āĻĒā§āϤā§_ āĻāĻžāĻ (āĻāĻā§āϏā§āϏ āĻāϰāĻŋ)āĨ¤
-The first argument is an empty object `{}`, which is the value of `person`. To this object, the custom behavior specified in the `handler` object gets added. If we add a property to the `person` object, `set` will get invoked. If we access a property on the `person` object, `get` gets invoked.
+āĻĒā§āϰāĻĨāĻŽ āĻāϰā§āĻā§āĻŽā§āύā§āĻāĻāĻŋ āĻšāϞ⧠āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻāĻž āĻ
āĻŦāĻā§āĻā§āĻ `{}`, āϝā§āĻāĻž `person` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻā§āϝāĻžāϞā§āĨ¤ āĻāĻ āĻ
āĻŦāĻā§āĻā§āĻā§, `handler` āĻ
āĻŦāĻā§āĻā§āĻā§ āĻŦāϰā§āύā§āϤ āĻāĻžāϏā§āĻāĻŽ āĻāĻāϰāĻŖāĻā§āϞ⧠āϝā§āĻā§āϤ āĻšā§ā§āĻā§āĨ¤ āϝāĻĻāĻŋ āĻāĻŽāϰāĻž `person` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āϝā§āĻā§āϤ āĻāϰāĻŋ, `set` āĻāϞ āĻšāĻŦā§āĨ¤ āϝāĻĻāĻŋ āĻāĻŽāϰāĻž `person` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻāĻā§āϏā§āϏ āĻāϰāĻŋ, `get` āĻāϞ āĻšāĻŦā§āĨ¤
-First, we added a new property `name` to the proxy object (`person.name = "Lydia"`). `set` gets invoked, and logs `"Added a new property!"`.
+āĻĒā§āϰāĻĨāĻŽā§, āĻāĻŽāϰāĻž āĻĒā§āϰāĻā§āϏāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§ āύāϤā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ `name` āϝā§āĻā§āϤ āĻāϰā§āĻāĻŋ (`person.name = "Lydia"`)āĨ¤ `set` āĻāϞ āĻšāĻŦā§, āĻāĻŦāĻ āϞāĻ āĻāϰ⧠`"Added a new property!"`āĨ¤
-Then, we access a property value on the proxy object, and the `get` property on the handler object is invoked. `"Accessed a property!"` gets logged.
+āĻāϰāĻĒāϰā§, āĻāĻŽāϰāĻž āĻĒā§āϰāĻā§āϏāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻāĻāĻāĻŋ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻāĻā§āϏā§āϏ āĻāϰāĻāĻŋ, āĻāĻŦāĻ āĻšā§āϝāĻžāύā§āĻĄāϞāĻžāϰ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `get` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻāϞ āĻšā§āĨ¤ `"Accessed a property!"` āϞāĻ āĻšā§āĨ¤
---
-###### 136. Which of the following will modify the `person` object?
+###### 136. āύāĻŋāĻā§āϰ āĻā§āύāĻāĻŋ `person` āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāĻŦā§?
```javascript
const person = { name: "Lydia Hallie" };
@@ -4492,16 +4492,16 @@ Object.seal(person);
#### āĻāϤā§āϤāϰ: A
-With `Object.seal` we can prevent new properties from being _added_, or existing properties to be _removed_.
+`Object.seal` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§, āĻāĻŽāϰāĻž āĻ
āĻŦāĻā§āĻā§āĻā§ āĻā§āύ āύāϤā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ _āϝā§āĻā§āϤ_ āĻāϰāĻžā§ āĻŦāĻžāϧāĻž āĻĻāĻŋāϤ⧠āĻĒāĻžāϰā§, āĻ
āĻĨāĻŦāĻž āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ _āĻŽā§āĻā§_ āĻĢā§āϞāĻžā§ āĻŦāĻžāϧāĻž āĻĻāĻŋāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤
-However, you can still modify the value of existing properties.
+āĻāĻŋāύā§āϤā§, āĻāĻĒāύāĻŋ āĻāĻāύ⧠āĻŦāĻŋāĻĻā§āϝāĻŽāĻžāύ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŦā§āύāĨ¤ āϝā§āĻŽāύ, `person.name = "Evan Bacon"`āĨ¤
---
-###### 137. Which of the following will modify the `person` object?
+###### 137. āύāĻŋāĻā§āϰ āĻā§āύāĻāĻŋ `person` āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāĻŦā§?
```javascript
const person = {
@@ -4524,9 +4524,9 @@ Object.freeze(person);
#### āĻāϤā§āϤāϰ: C
-The `Object.freeze` method _freezes_ an object. No properties can be added, modified, or removed.
+`Object.freeze` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§, āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻāĻā§ _āϏāĻāϰāĻā§āώāĻŋāϤ_ āĻŦāĻž _āĻĢā§āϰāĻŋāĻ_ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤ āĻ
āϰā§āĻĨāĻžā§ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āϝā§āĻā§āϤ āĻāϰāĻž, āĻŽā§āĻā§ āĻĢā§āϞāĻž, āĻŦāĻž āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāĻž āϝāĻžāĻŦā§ āύāĻžāĨ¤
-However, it only _shallowly_ freezes the object, meaning that only _direct_ properties on the object are frozen. If the property is another object, like `address` in this case, the properties on that object aren't frozen, and can be modified.
+āĻāĻŋāύā§āϤā§, āĻāĻāĻž āĻā§āĻŦāϞ _āĻ
āĻāĻā§āϰāĻāĻžāĻŦā§_ āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āĻĢā§āϰāĻŋāĻ āĻāϰā§, āĻŽāĻžāύ⧠āĻšāϞ⧠āϝ⧠āĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻā§āĻŦāϞ _āĻĒā§āϰāϤāĻā§āώā§āϝ_ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏ (first level) āĻā§āϞā§āĻā§ āĻĢā§āϰāĻŋāĻ āĻāϰā§, āϝā§āĻŽāύ āĻāĻā§āώā§āϤā§āϰ⧠`address`, āĻāĻ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏāĻā§āϞ⧠āĻĢā§āϰāĻŋāĻ āĻšā§āύāĻŋ, āĻāĻŦāĻ ā§āĻĻā§āϰ āĻĒā§āϰāĻāĻŦāϰā§āϤāύ āĻāϰāĻž āϝāĻžāĻŦā§āĨ¤ āϝā§āĻŽāύ, `person.address.street = "101 Main St"`āĨ¤
@@ -4556,9 +4556,9 @@ myFunc(3);
#### āĻāϤā§āϤāϰ: A
-First, we invoked `myFunc()` without passing any arguments. Since we didn't pass arguments, `num` and `value` got their default values: num is `2`, and `value` is the returned value of the function `add`. To the `add` function, we pass `num` as an argument, which had the value of `2`. `add` returns `4`, which is the value of `value`.
+āĻĒā§āϰāĻĨāĻŽā§, āĻāĻŽāϰāĻž āĻā§āύ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻāĻžā§āĻžāĻ `myFunc()` āĻā§ āĻāϞ āĻāϰā§āĻāĻŋāĨ¤ āϝā§āĻšā§āϤ⧠āĻā§ āύāĻžāϰā§āĻā§āĻŽā§āύā§āĻ āĻĒāĻžāϏ āĻāϰāĻŋāύāĻŋ, `num` āĻ `value` āϤāĻžāĻĻā§āϰ āĻā§āϝāĻžāϞ⧠āĻšāĻŋāϏā§āĻŦā§ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞā§āĻ āĻĒāĻžāĻā§āĻā§āĻ `num` āĻšāϞ `2`, āĻāĻŦāĻ `value` āĻšāϞ `add` āĻĢāĻžāĻāĻļāύā§āϰ āϰāĻŋāĻāĻžāϰā§āύ āĻā§āϝāĻžāϞā§āĨ¤ `add` āĻĢāĻžāĻāĻļāύ⧠āĻāĻŽāϰāĻž āĻāĻāĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻĒāĻžāϏ āĻāϰā§āĻāĻŋ `num`, āϝā§āĻāĻžāϰ āĻā§āϝāĻžāϞ⧠āĻšāϞ `2`āĨ¤ `add` āĻĢāĻžāĻāĻļāύ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`4`, āĻāĻāĻžāĻ āĻšāϞ⧠`value`-āϰ āĻā§āϝāĻžāϞā§āĨ¤
-Then, we invoked `myFunc(3)` and passed the value `3` as the value for the argument `num`. We didn't pass an argument for `value`. Since we didn't pass a value for the `value` argument, it got the default value: the returned value of the `add` function. To `add`, we pass `num`, which has the value of `3`. `add` returns `6`, which is the value of `value`.
+āĻĒāϰāĻŦāϰā§āϤā§āϤā§, āĻāĻŽāϰāĻž `myFunc(3)` āĻāϰāĻāĻŋ, āĻāĻāĻžāύ⧠`3` āĻā§ āĻĒāĻžāϏ āĻāϰāĻāĻŋ `num` āĻāϰā§āĻā§āĻŽā§āύā§āĻā§āϰ āĻā§āϝāĻžāϞ⧠āĻšāĻŋāϏā§āĻŦā§āĨ¤ āĻāĻŽāϰāĻž `value` āĻāϰā§āĻā§āĻŽā§āύā§āĻā§āϰ āĻā§āύ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻŋāύāĻŋ, āĻāĻāĻž āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāĻā§āĻā§āĻ `add` āĻĢāĻžāĻāĻļāύā§āϰ āϰāĻŋāĻāĻžāϰā§āύ āĻā§āϝāĻžāϞā§āĨ¤ `add` āĻĢāĻžāĻāĻļāύ⧠āĻāĻŽāϰāĻž `num` āĻĒāĻžāϏ āĻāϰā§āĻāĻŋ, āϝā§āĻāĻžāϰ āĻā§āϝāĻžāϞ⧠`3`āĨ¤ `add` āĻĢāĻžāĻāĻļāύā§āϰ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`6`, āĻāĻāĻžāĻ āĻšāϞ⧠`value`-āϰ āĻā§āϝāĻžāϞā§āĨ¤
@@ -4596,14 +4596,14 @@ console.log(counter.#number);
#### āĻāϤā§āϤāϰ: D
-In ES2020, we can add private variables in classes by using the `#`. We cannot access these variables outside of the class. When we try to log `counter.#number`, a SyntaxError gets thrown: we cannot access it outside the `Counter` class!
+āĻāĻāϏ⧍ā§Ļ⧍ā§Ļ āĻ, āĻā§āϞāĻžāϏā§āϰ āĻā§āϤāϰ āĻāĻŽāĻžāϰāĻž āĻĒā§āϰāĻžāĻāĻā§āĻ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞ āϝā§āĻā§āϤ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ `#` āĻŦā§āϝāĻžāĻŦāĻšāĻžāϰ āĻāϰā§āĨ¤ āĻāĻŽāϰāĻž āĻāĻ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻā§āϞā§āĻā§ āĻā§āϞāĻžāϏā§āϰ āĻŦāĻžāĻāϰ⧠āĻĨā§āĻā§ āĻāĻā§āϏā§āϏ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ āύāĻžāĨ¤ āϝāĻāύ `counter.#number` āĻā§ āϞāĻ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻž āĻšā§, SyntaxError āĻā§ā§āĻž āĻšā§āĻ we cannot access it outside the `Counter` class!
---
-###### 140. What's missing?
+###### 140. āĻāĻāĻžāύ⧠āĻŽāĻŋāϏāĻŋāĻ āĻ
āĻāĻļā§ āĻāĻŋ āĻšāĻŦā§?
```javascript
const teams = [
@@ -4638,9 +4638,9 @@ obj.next(); // { value: "Lisa", done: false }
#### āĻāϤā§āϤāϰ: B
-In order to iterate over the `members` in each element in the `teams` array, we need to pass `teams[i].members` to the `getMembers` generator function. The generator function returns a generator object. In order to iterate over each element in this generator object, we need to use `yield*`.
+`teams` āĻ
ā§āϝāĻžāϰā§āϰ āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āĻāύā§āϝ `members` āĻāϰ āĻāĻĒāϰ āϞā§āĻĒ āĻāĻžāϞāĻžāϤ⧠āĻšāϞā§, `getMembers` āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ⧠`teams[i].members` āĻā§ āĻĒāĻžāϏ āĻāϰāϤ⧠āĻšāĻŦā§āĨ¤ āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠āĻāĻāĻāĻŋ āĻā§āύāĻžāϰā§āĻāϰ āĻ
āĻŦāĻā§āĻā§āĻāĨ¤ āĻā§āύāĻžāϰā§āĻāϰ āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻāϞāĻŋāĻŽā§āύā§āĻā§āϰ āĻāĻĒāϰ āϞā§āĻĒ āĻāĻžāϞāĻžāύā§āύā§āϰ āĻāύā§āϝ, āĻāĻŽāĻžāĻĻā§āϰāĻā§ `yield*` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻšāĻŦā§āĨ¤
-If we would've written `yield`, `return yield`, or `return`, the entire generator function would've gotten returned the first time we called the `next` method.
+āϝāĻĻāĻŋ āĻāĻŽāϰāĻž `yield`, `return yield`, āĻŦāĻž `return` āϞāĻŋāĻāϤāĻžāĻŽ, āϏāĻŽā§āĻĒā§āϰā§āύ āĻā§āύā§āϰāĻžāĻāϰ āĻĢāĻžāĻāĻļāύāĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻĒā§āϤāĻžāĻŽ āĻĒā§āϰāĻĨāĻŽāĻŦāĻžāϰ `next` āĻŽā§āĻĨāĻĄ āĻāϰāĻžāϰ āĻĒāϰā§āĨ¤
@@ -4677,15 +4677,13 @@ console.log(person.hobbies);
#### āĻāϤā§āϤāϰ: C
-The `addHobby` function receives two arguments, `hobby` and `hobbies` with the default value of the `hobbies` array on the `person` object.
+`addHobby` āĻĢāĻžāĻāĻļāύāĻāĻŋ ⧍āĻāĻŋ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻā§āϰāĻšāĻŖ āĻāϰā§, `hobby` āĻ `hobbies` - āϝāĻžāϰ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞ⧠āĻšāϞ⧠`person` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `hobbies` āĻ
ā§āϝāĻžāϰā§āĨ¤
-First, we invoke the `addHobby` function, and pass `"running"` as the value for `hobby` and an empty array as the value for `hobbies`. Since we pass an empty array as the value for `hobbies`, `"running"` gets added to this empty array.
+āĻĒā§āϰāĻĨāĻŽā§, āĻāĻŽāϰāĻž `addHobby` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāϞ āĻāϰāĻāĻŋ āĻāĻŦāĻ `hobby`-āĻāϰ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻāĻŋ `"running"` āĻāĻŦāĻ `hobbies`-āĻāϰ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻāĻŋ āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻāĻž āĻ
ā§āϝāĻžāϰā§āĨ¤ āϝā§āĻšā§āϤ⧠āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻāĻž āĻ
ā§āϝāĻžāϰ⧠āĻĒāĻžāϏ āĻāϰāĻāĻŋ `hobbies`-āĻāϰ āĻā§āϝāĻžāϞ⧠āĻšāĻŋāϏā§āĻŦā§, `"running"` āϝā§āĻā§āϤ āĻšāĻā§āĻā§ āĻāĻ āĻĢāĻžāĻāĻāĻž āĻ
ā§āϝāĻžāϰā§āϤā§āĨ¤
-Then, we invoke the `addHobby` function, and pass `"dancing"` as the value for `hobby`. We didn't pass a value for `hobbies`, so it gets the default value, the `hobbies` property on the `person` object. We push the hobby `dancing` to the `person.hobbies` array.
+āĻāϰāĻĒāϰā§, āĻāĻŽāϰāĻž `addHobby` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāϞ āĻāϰāĻāĻŋ āĻāĻŦāĻ `hobby`-āĻāϰ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻāĻŋ `"dancing"`āĨ¤ `hobbies` āĻāϰ āĻāύā§āϝ āĻāĻŽāϰāĻž āĻā§āύ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻŋāύāĻŋ, āϤāĻžāĻ āĻāĻāĻžāϰ āĻā§āϝāĻžāϞ⧠āĻšā§ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞā§āĻāĻŋāĻ, āĻā§āϝāĻžāϞā§āĻāĻŋ āĻšāϞ⧠`person` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `hobbies` āĻ
ā§āϝāĻžāϰā§āĨ¤ āĻāĻŽāϰāĻž `person.hobbies` āĻ
ā§āϝāĻžāϰā§āϤ⧠`"dancing"` āϝā§āĻā§āϤ (āĻĒā§āĻļ) āĻāϰāĻāĻŋāĨ¤
-Last, we invoke the `addHobby` function, and pass `"baking"` as the value for `hobby`, and the `person.hobbies` array as the value for `hobbies`. We push the hobby `baking` to the `person.hobbies` array.
-
-After pushing `dancing` and `baking`, the value of `person.hobbies` is `["coding", "dancing", "baking"]`
+āϏāϰā§āĻļā§āώā§, āĻāĻŽāϰāĻž `addHobby` āĻĢāĻžāĻāĻļāύāĻāĻŋ āĻāϞ āĻāϰāĻāĻŋ āĻāĻŦāĻ `hobby`-āĻāϰ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻāĻŋ `"baking"`, āĻāĻŦāĻ `hobbies`-āĻāϰ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻāĻŋ `person.hobbies` āĻ
ā§āϝāĻžāϰā§āĻāĻŋāĨ¤ āĻāĻŽāϰāĻž `person.hobbies` āĻ
ā§āϝāĻžāϰā§āϤ⧠`"baking"` āϝā§āĻā§āϤ (āĻĒā§āĻļ) āĻāϰāĻāĻŋāĨ¤
@@ -4721,14 +4719,14 @@ const pet = new Flamingo();
#### āĻāϤā§āϤāϰ: B
-We create the variable `pet` which is an instance of the `Flamingo` class. When we instantiate this instance, the `constructor` on `Flamingo` gets called. First, `"I'm pink. đ¸"` gets logged, after which we call `super()`. `super()` calls the constructor of the parent class, `Bird`. The constructor in `Bird` gets called, and logs `"I'm a bird. đĻĸ"`.
+āĻāĻŽāϰāĻž `pet` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻāĻŋ āϤā§āϰāĻŋ āĻāϰā§āĻāĻŋ āϝā§āĻāĻž `Flamingo` āĻā§āϞāĻžāϏā§āϰ āĻāĻāĻāĻŋ āĻāύā§āϏāĻā§āϝāĻžāύā§āϏāĨ¤ āϝāĻāύ āĻāĻŽāϰāĻž āĻāĻ āĻāύā§āϏāĻā§āϝāĻžāύā§āϏāĻāĻŋāĻā§ āĻāύā§āϏāĻā§āϝāĻžāύāĻļāĻŋā§ā§āĻ (`new Flamingo()`) āĻāϰāĻŋ, `Flamingo` āĻā§āϞāĻžāϏā§āϰ āĻāύā§āϏāĻā§āϰāĻžāĻā§āĻāϰ āĻāϞ āĻšā§āĨ¤ āĻĒā§āϰāĻĨāĻŽā§, `"I'm pink. đ¸"` āϞāĻ āĻšā§, āĻāϰāĻĒāϰ⧠āĻāĻŽāϰāĻž `super()` āĻāϞ āĻāϰāĻŋāĨ¤ `super()` āĻĒā§āϝāĻžāϰā§āύā§āĻ āĻā§āϞāĻžāϏ `Bird`-āĻāϰ āĻāύā§āϏāĻā§āϰāĻžāĻā§āĻāϰāĻā§ āĻāϞ āĻāϰā§āĨ¤ `Bird` āĻā§āϞāĻžāϏā§āϰ āĻāύā§āϏāĻā§āϰāĻžāĻā§āĻāϰ āĻāϞ āĻšā§ āĻāĻŦāĻ āϞāĻ āĻāϰ⧠`"I'm a bird. đĻĸ"`āĨ¤
---
-###### 143. Which of the options result(s) in an error?
+###### 143. āĻā§āύ āĻ
āĻĒāĻļāύāĻāĻŋ āĻāϰāϰ āϰā§āĻāĻžāϞā§āĻ āĻĻā§ā§?
```javascript
const emojis = ["đ", "đ
đŧ", "đ", "â"];
@@ -4749,14 +4747,14 @@ const emojis = ["đ", "đ
đŧ", "đ", "â"];
#### āĻāϤā§āϤāϰ: D
-The `const` keyword simply means we cannot _redeclare_ the value of that variable, it's _read-only_. However, the value itself isn't immutable. The properties on the `emojis` array can be modified, for example by pushing new values, splicing them, or setting the length of the array to 0.
+`const` āĻāĻŋāĻā§āĻžāϰā§āĻĄ āĻĻāĻŋā§ā§ āύā§ā§āĻž āĻā§āύ āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞā§āϰ āĻā§āϝāĻžāϞā§āĻā§ āĻāĻŽāϰāĻž _āϰāĻŋāĻĄāĻŋāĻā§āϞā§ā§āĻžāϰ_ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŦ āύāĻž (`emojis = [...emojis, "đĨ"]`), āĻāĻāĻž āĻā§āĻŦāϞ _āϰāĻŋāĻĄ-āĻ
āύāϞāĻŋ_āĨ¤ āĻāĻŋāύā§āϤ⧠āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞā§āϰ āĻā§āϝāĻžāϞā§āĻā§āϞ⧠āύāĻŋāĻā§āϰāĻž āĻ
āĻĒāϰāĻŋāĻŦāϰā§āϤāύā§ā§ āύā§āĨ¤ āĻ
āϰā§āĻĨāĻžā§ `emojis` āĻ
ā§āϝāĻžāϰā§āϰ āĻāϞāĻŋāĻŽā§āύā§āĻāĻā§āϞā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāĻž āϝāĻžāĻŦā§, āĻāĻĻāĻžāĻšāϰāĻŖāϏā§āĻŦāϰā§āĻĒ, āύāϤā§āύ āĻā§āϝāĻžāϞ⧠āĻĒā§āĻļ (āϝā§āĻā§āϤ) āĻāϰāĻž (`emojis.push("đĻ")`), āϏā§āĻĒā§āϞāĻžāĻāϏ āĻāϰāĻž (āύāĻŋāϰā§āĻĻāĻŋāώā§āĻ āĻāύāĻĄā§āĻā§āϏ⧠āĻā§āϝāĻžāϞ⧠āϝā§āĻā§āϤ āĻāϰāĻž) (`emojis.splice(0, 2)`), āĻŦāĻž āĻ
ā§āϝāĻžāϰā§āϰ āϞā§āύā§āĻĨāĻā§ āĻāĻŋāϰ⧠(`emojis.length = 0`) āϏā§āĻ āĻāϰāĻžāĨ¤
---
-###### 144. What do we need to add to the `person` object to get `["Lydia Hallie", 21]` as the output of `[...person]`?
+###### 144. `[...person]` āĻāϰ āĻāĻāĻāĻĒā§āĻ `["Lydia Hallie", 21]` āĻĒā§āϤ⧠āĻšāϞ⧠`person` āĻ
āĻŦāĻā§āĻā§āĻā§ āĻāĻŽāĻžāĻĻā§āϰ āĻāĻŋ āϝā§āĻā§āϤ āĻāϰāϤ⧠āĻšāĻŦā§?
```javascript
const person = {
@@ -4777,7 +4775,7 @@ const person = {
#### āĻāϤā§āϤāϰ: C
-Objects aren't iterable by default. An iterable is an iterable if the iterator protocol is present. We can add this manually by adding the iterator symbol `[Symbol.iterator]`, which has to return a generator object, for example by making it a generator function `*[Symbol.iterator]() {}`. This generator function has to yield the `Object.values` of the `person` object if we want it to return the array `["Lydia Hallie", 21]`: `yield* Object.values(this)`.
+āĻ
āĻŦāĻā§āĻā§āĻ āĻĄāĻŋāĻĢāϞā§āĻāĻāĻžāĻŦā§ āĻāĻāĻžāϰā§āĻŦāϞ āύā§āĨ¤ āĻāĻāĻāĻŋ āĻāĻāĻžāϰā§āĻŦāϞ āĻāĻāĻžāϰā§āĻŦāϞ āĻšā§ āϝāĻĻāĻŋ āĻāĻāĻžāϰā§āĻāϰ āĻĒā§āϰā§āĻā§āĻāϞ āĻĨāĻžāĻā§āĨ¤ āĻāĻŽāϰāĻž āĻāĻāĻž āύāĻŋāĻāĻžāϰāĻž āϝā§āĻā§āϤ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋ āĻāĻāĻžāϰā§āĻāϰ āϏāĻŋāĻŽā§āĻŦāϞ `[Symbol.iterator]` āϝā§āĻā§āϤ āĻāϰāĻžāϰ āĻŽāĻžāϧā§āϝāĻŽā§, āϝā§āĻāĻžāĻā§ āĻāĻāĻāĻŋ āĻā§āύāĻžāϰā§āĻāϰ āĻ
āĻŦāĻā§āĻā§āĻ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāϤ⧠āĻšāĻŦā§, āĻāĻĻāĻžāĻšāϰāĻŖāϏā§āĻŦāϰā§āĻĒ āĻāĻāĻžāĻā§ āĻāĻāĻāĻŋ āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ `*[Symbol.iterator]() {}` āĻāϰāĻžāϰ āĻŽāĻžāϧā§āϝāĻŽā§āĨ¤ āĻāĻ āĻā§āύāĻžāϰā§āĻāϰ āĻĢāĻžāĻāĻļāύ `person` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `Object.values` āĻā§ āĻāϞā§āĻĄ āĻāϰāϤ⧠āĻšāĻŦā§ āϝāĻĻāĻŋ āĻāĻŽāϰāĻž āĻāĻžāĻ āĻāĻāĻž āĻ
ā§āϝāĻžāϰā§āĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻŦā§āĻ `["Lydia Hallie", 21]`: `yield* Object.values(this)`
@@ -4807,7 +4805,7 @@ console.log(count);
#### āĻāϤā§āϤāϰ: C
-The `if` condition within the `forEach` loop checks whether the value of `num` is truthy or falsy. Since the first number in the `nums` array is `0`, a falsy value, the `if` statement's code block won't be executed. `count` only gets incremented for the other 3 numbers in the `nums` array, `1`, `2` and `3`. Since `count` gets incremented by `1` 3 times, the value of `count` is `3`.
+`forEach` āϞā§āĻĒā§āϰ `if` āĻļāϰā§āϤāĻāĻŋ āĻā§āĻ āĻāϰāĻā§ `num` āĻāϰ āĻā§āϝāĻžāϞ⧠āĻā§āϰā§āĻĨāĻŋ āĻŦāĻž āĻĢāϞāϏāĻŋ āĻāĻŋāύāĻžāĨ¤ āϝā§āĻšā§āϤ⧠`num` āĻ
ā§āϝāĻžāϰā§āϰ ā§§āĻŽ āύāĻžāĻŽā§āĻŦāĻžāϰāĻāĻŋ `0`, āĻāĻāĻāĻŋ āĻĢāϞāϏāĻŋ āĻā§āϝāĻžāϞā§, āϤāĻžāĻ `if` āϏā§āĻā§āĻāĻŽā§āύā§āĻā§āϰ āĻā§āĻĄ āĻŦā§āϞāĻāĻāĻŋ āĻāϞāĻŦā§ āύāĻžāĨ¤ `count` āĻā§āĻŦāϞ āĻ
āύā§āϝ ā§ŠāĻāĻŋ āύāĻžāĻŽā§āĻŦāĻžāϰā§āϰ āĻāύā§āϝ āĻŦā§āĻĻā§āϧāĻŋ āĻĒāĻžāĻŦā§, `1`, `2` āĻ `3`āĨ¤ āϝā§āĻšā§āϤ⧠`count` `1` āĻāĻ°ā§ ā§ŠāĻŦāĻžāϰ āĻŦā§āĻĻā§āϧāĻŋ āĻĒāĻžā§, `count` āĻāϰ āĻā§āϝāĻžāϞ⧠āĻāĻāύ āĻšā§ā§āĻā§ `3`āĨ¤
@@ -4836,13 +4834,13 @@ getFruit([["đ"], ["đ", "đ"]]);
#### āĻāϤā§āϤāϰ: D
-The `?` allows us to optionally access deeper nested properties within objects. We're trying to log the item on index `1` within the subarray that's on index `1` of the `fruits` array. If the subarray on index `1` in the `fruits` array doesn't exist, it'll simply return `undefined`. If the subarray on index `1` in the `fruits` array exists, but this subarray doesn't have an item on its `1` index, it'll also return `undefined`.
+`?.` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻāĻŽāϰāĻž āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻĄāĻŋāĻĒāĻžāϰ āύā§āϏā§āĻā§āĻĄ āĻā§āύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻā§ āĻ
āĻĒāĻļāύāĻžāϞāĻŋ āĻāĻā§āϏā§āϏ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŋāĨ¤ āĻāĻŽāϰāĻž āĻā§āώā§āĻāĻž āĻāϰāĻāĻŋ āϏāĻžāĻŦ-āĻ
ā§āϝāĻžāϰā§āϰ āĻāύāĻĄā§āĻā§āϏ `1` āĻāĻāĻā§āĻŽāĻāĻŋāĻā§ āϞāĻ āĻāϰāĻžāϰ āϝā§āĻāĻž `fruits` āĻ
ā§āϝāĻžāϰā§āϰ āĻāύāĻĄā§āĻā§āϏ `1` āĻ āĻ
āĻŦāϏā§āĻĨāĻŋāϤāĨ¤ āϝāĻĻāĻŋ `fruits` āĻ
ā§āϝāĻžāϰā§āϰ āĻāύāĻĄā§āĻā§āϏ `1` āĻ āϏāĻžāĻŦ-āĻ
ā§āϝāĻžāϰā§āĻāĻŋāĻā§ āĻĒāĻžāĻā§āĻž āύāĻž āϝāĻžā§, āĻāĻāĻž `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻŦā§āĨ¤ āϝāĻĻāĻŋ `fruits` āĻ
ā§āϝāĻžāϰā§āϰ āĻāύāĻĄā§āĻā§āϏ `1` āĻ āϏāĻžāĻŦ-āĻ
ā§āϝāĻžāϰā§āĻāĻŋāĻā§ āĻĒāĻžāĻā§āĻž āϝāĻžā§, āĻāĻŋāύā§āϤ⧠āϏāĻžāĻŦ-āĻ
ā§āϝāĻžāϰā§āϤ⧠āĻāύāĻĄā§āĻā§āϏ `1` āĻāĻāĻā§āĻŽāĻāĻŋāĻā§ āĻĒāĻžāĻā§āĻž āύāĻž āϝāĻžā§ āϤāĻāύāĻ āĻāĻāĻž `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻŦā§āĨ¤
-First, we're trying to log the second item in the `['đ']` subarray of `[['đ', 'đ'], ['đ']]`. This subarray only contains one item, which means there is no item on index `1`, and returns `undefined`.
+āĻĒā§āϰāĻĨāĻŽā§, āĻāĻŽāϰāĻž āϞāĻ āĻāϰāĻžāϰ āĻā§āώā§āĻāĻž āĻāϰāĻāĻŋ `[['đ', 'đ'], ['đ']]`-āĻ
ā§āϝāĻžāϰā§āĻāĻŋāϰ āϏāĻžāĻŦ-āĻ
ā§āϝāĻžāϰ⧠`['đ']` āĻĨā§āĻā§ āĻĻā§āĻŦāĻŋāϤā§ā§ āĻāĻāĻā§āĻŽāĻāĻŋāĨ¤ āĻāĻ āϏāĻžāĻŦ-āĻ
ā§āϝāĻžāϰā§āϤ⧠āĻā§āĻŦāϞ āĻāĻāĻāĻŋ āĻāĻāĻā§āĻŽāĻ āĻāĻā§, āϝāĻžāϰ āĻŽāĻžāύ⧠āĻšāϞ āĻāϰ āĻāύāĻĄā§āĻā§āϏ `1`-āĻ āĻāĻŋāĻā§ āύā§āĻ āϤāĻžāĻ `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§āĨ¤
-Then, we're invoking the `getFruits` function without passing a value as an argument, which means that `fruits` has a value of `undefined` by default. Since we're conditionally chaining the item on index `1` of`fruits`, it returns `undefined` since this item on index `1` does not exist.
+āĻāϰāĻĒāϰ, `getFruits` āĻĢāĻžāĻāĻļāύāĻāĻŋāĻā§ āĻāϞ āĻāϰā§āĻāĻŋ āĻā§āύ āĻā§āϝāĻžāϞā§āĻā§ āĻāϰā§āĻā§āĻŽā§āύā§āĻ āĻšāĻŋāϏā§āĻŦā§ āĻĒāĻžāϏ āύāĻž āĻāϰā§āĻ, āϝāĻžāϰ āĻŽāĻžāύ⧠āĻšā§ `fruits` āĻāϰ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāĻā§āĻā§ `undefined`āĨ¤ āϝā§āĻšā§āϤā§, āĻāĻŽāϰāĻž `fruits` āĻ
ā§āϝāĻžāϰā§āϰ āĻāύāĻĄā§āĻā§āϏ `1` āĻāĻāĻā§āĻŽāĻā§ āĻāύā§āĻĄāĻŋāĻļāύāĻžāϞāĻŋ āĻā§āĻāύāĻŋāĻ āĻāϰāĻāĻŋ, āĻāĻāĻž `undefined` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§ āĻāĻžāϰāύ āĻāύāĻĄā§āĻā§āϏ `1` āĻāϰ āĻāĻāĻā§āĻŽ āύā§āĻāĨ¤
-Lastly, we're trying to log the second item in the `['đ', 'đ']` subarray of `['đ'], ['đ', 'đ']`. The item on index `1` within this subarray is `đ`, which gets logged.
+āϏāϰā§āĻŦāĻļā§āώā§, āĻāĻŽāϰāĻž āĻā§āώā§āĻāĻž āϞāĻ āĻāϰāĻžāϰ āĻāϰāĻāĻŋ `[["đ"], ["đ", "đ"]]`-āĻ
ā§āϝāĻžāϰā§āĻāĻŋāϰ āϏāĻžāĻŦ-āĻ
ā§āϝāĻžāϰ⧠`['đ', 'đ']` āĻĨā§āĻā§ āĻĻā§āĻŦāĻŋāϤā§ā§ āĻāĻāĻā§āĻŽāĻāĻŋāĨ¤ āϏāĻžāĻŦ-āĻ
ā§āϝāĻžāϰā§āϰ āĻāύāĻĄā§āĻā§āϏ `1` āĻāϰ āĻāĻāĻā§āĻŽāĻāĻŋ āĻšāϞ `đ`, āĻāĻāĻŋāĻ āϞāĻ āĻšā§ā§āĻā§āĨ¤
@@ -4878,7 +4876,7 @@ console.log(calc.count);
#### āĻāϤā§āϤāϰ: A
-We set the variable `calc` equal to a new instance of the `Calc` class. Then, we instantiate a new instance of `Calc`, and invoke the `increase` method on this instance. Since the count property is within the constructor of the `Calc` class, the count property is not shared on the prototype of `Calc`. This means that the value of count has not been updated for the instance calc points to, count is still `0`.
+āĻāĻŽāϰāĻž `calc` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻā§ āϏā§āĻ āĻāϰā§āĻāĻŋ `Calc` āĻā§āϞāĻžāϏā§āϰ āύāϤā§āύ āĻāύā§āϏāĻā§āϝāĻžāύā§āϏā§āϰ āϏāĻŽāĻžāύāĨ¤ āĻāϰāĻĒāϰ, āĻāĻŽāϰāĻž `Calc` āĻā§āϞāĻžāϏā§āϰ āύāϤā§āύ āĻāĻāĻāĻŋ āĻāύā§āϏāĻā§āϝāĻžāύā§āϏāĻā§ āĻāύā§āϏāĻā§āϝāĻžāύā§āϏāĻŋā§ā§āĻ āĻāϰā§āĻāĻŋ, āĻāĻŦāĻ āĻāĻ āĻāύā§āϏāĻā§āϝāĻžāύā§āϏ āĻĻāĻŋā§ā§ `increase` āĻŽā§āĻĨāĻĄ āĻāϞ āĻāϰā§āĻāĻŋāĨ¤ āϝā§āĻšā§āϤ⧠`count` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻāĻŋ `Calc` āĻā§āϞāĻžāϏā§āϰ āĻāύā§āϏāĻā§āϰāĻžāĻā§āĻāϰā§āϰ āĻā§āϤāϰ āĻāĻā§, āϤāĻžāĻ āĻāĻ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻāĻŋ `Calc` āĻā§āϞāĻžāϏā§āϰ āĻĒā§āϰā§āĻā§āĻāĻžāĻāĻĒā§ āĻļā§ā§āĻžāϰ āĻšā§āύāĻŋāĨ¤ āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ āϝ⧠`count` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞā§āĻāĻŋāϰ āĻā§āύ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻšā§āύāĻŋ āύāϤā§āύ āĻāύā§āϏāĻā§āϝāĻžāύā§āϏ āϝ⧠`Calc` āĻā§āϞāĻžāϏāĻā§ āĻĒā§ā§āύā§āĻ āĻāϰāĻā§ āϤāĻžāϰ āĻāύā§āϝ, āϤāĻžāĻ `count` āĻāĻāύ⧠`0`āĨ¤
@@ -4920,7 +4918,7 @@ console.log(updatedUser === user);
#### āĻāϤā§āϤāϰ: B
-The `updateUser` function updates the values of the `email` and `password` properties on user, if their values are passed to the function, after which the function returns the `user` object. The returned value of the `updateUser` function is the `user` object, which means that the value of updatedUser is a reference to the same `user` object that `user` points to. `updatedUser === user` equals `true`.
+`updateUser` āĻĢāĻžāĻāĻļāύāĻāĻŋ `user` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `email` āĻ `password` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰ⧠āϝāĻĻāĻŋ āĻĢāĻžāĻāĻļāύ⧠āϤāĻžāĻĻā§āϰ āĻā§āϝāĻžāϞā§āĻā§āϞā§āĻā§ āĻĒāĻžāϏ āĻāϰāĻž āĻšā§, āĻāϰāĻĒāϰ⧠āĻĢāĻžāĻāĻļāύāĻāĻŋ `user` āĻ
āĻŦāĻā§āĻā§āĻāĻāĻŋāĻā§ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĨ¤ `updateUser` āĻĢāĻžāĻāĻļāύāĻāĻŋāϰ āϰāĻŋāĻāĻžāϰā§āύ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻšāϞ `user` āĻ
āĻŦāĻā§āĻā§āĻ, āϝāĻžāϰ āĻŽāĻžāύ⧠`updateUser` āĻāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻšāϞ āĻāĻāĻ `user` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āϰā§āĻĢāĻžāϰā§āύā§āϏ āϝā§āĻāĻž `user` āĻĒā§ā§āύā§āĻ āĻāϰāĻā§āĨ¤ āĻĢāϞ⧠`updatedUser === user` āϏāĻŽāĻžāύ āĻšāĻā§āĻā§ `true`āĨ¤
@@ -4949,9 +4947,11 @@ console.log(fruit);
#### āĻāϤā§āϤāϰ: C
-First, we invoke the `slice` method on the fruit array. The slice method does not modify the original array, but returns the value that it sliced off the array: the banana emoji.
-Then, we invoke the `splice` method on the fruit array. The splice method does modify the original array, which means that the fruit array now consists of `['đ', 'đ']`.
-At last, we invoke the `unshift` method on the `fruit` array, which modifies the original array by adding the provided value, âđâ in this case, as the first element in the array. The fruit array now consists of `['đ', 'đ', 'đ']`.
+āĻĒā§āϰāĻĨāĻŽā§, āĻāĻŽāϰāĻž `fruit` āĻ
ā§āϝāĻžāϰā§āϤ⧠`slice` āĻŽā§āĻĨāĻĄ āĻāϞ āĻāϰā§āĻāĻŋāĨ¤ `slice` āĻŽā§āĻĨāĻĄ āĻāϏāϞ āĻ
ā§āϝāĻžāϰā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰ⧠āύāĻž, āĻāĻŋāύā§āϤ⧠āĻ
ā§āϝāĻžāϰ⧠āĻĨā§āĻā§ āĻāύā§āĻĄāĻŋāϤ (āϏā§āϞāĻžāĻāϏ) āĻāϰ⧠āĻāύāĻž āĻāĻāĻā§āĻŽ/āĻā§āϞ⧠āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§āĻ āĻāĻā§āώā§āϤā§āϰā§, āĻāϞāĻžāϰ āĻāĻŽāĻāĻŋ `'đ'`āĨ¤
+
+āĻāϰāĻĒāϰā§, āĻāĻŽāϰāĻž `fruit` āĻ
ā§āϝāĻžāϰā§āϤ⧠`splice` āĻŽā§āĻĨāĻĄ āĻāϞ āĻāϰā§āĻāĻŋāĨ¤ `splice` āĻŽā§āĻĨāĻĄ āĻāϏāϞ āĻ
ā§āϝāĻžāϰā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§, āϝāĻžāϰ āĻŽāĻžāύ⧠āĻšāϞ, āĻāĻāύ `fruit` āĻ
ā§āϝāĻžāϰā§āϤ⧠āĻ
āĻŦāĻļāĻŋāώā§āĻ āĻāĻā§ `['đ', 'đ']`āĨ¤
+
+āϏāϰā§āĻŦāĻļā§āώā§, āĻāĻŽāϰāĻž `fruit` āĻ
ā§āϝāĻžāϰā§āϤ⧠`unshift` āĻŽā§āĻĨāĻĄ āĻāϞ āĻāϰā§āĻāĻŋāĨ¤ `unshift` āĻŽā§āĻĨāĻĄā§ āĻĒāĻžāϏ āĻāϰāĻž āĻā§āϝāĻžāϞā§/āĻā§āϞā§āĻā§ āĻ
ā§āϝāĻžāϰā§āϤ⧠āϝā§āĻā§āϤ āĻāϰāĻžāϰ āĻŽāĻžāϧā§āϝāĻŽā§ āϏ⧠āĻāϏāϞ āĻ
ā§āϝāĻžāϰā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§, āĻāĻā§āώā§āϤā§āϰ⧠āĻ
ā§āϝāĻžāϰā§āϰ āĻĒā§āϰāĻĨāĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻ āĻšāĻŋāϏā§āĻŦā§āĨ¤ āϤāĻžāĻ āĻāĻāύ `fruit` āĻ
ā§āϝāĻžāϰā§āĻāĻŋāϤ⧠āĻĨāĻžāĻāĻā§ `['đ', 'đ', 'đ']`āĨ¤
@@ -4981,13 +4981,13 @@ console.log(animals[dog]);
#### āĻāϤā§āϤāϰ: B
-Object keys are converted to strings.
+āĻ
āĻŦāĻā§āĻā§āĻā§āϰ āĻāĻŋ-āĻā§āϞā§āĻā§ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻāĻā§āĻāĻŋāύ āϏā§āĻā§āϰāĻŋāĻ-āĻ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§āĨ¤
-Since the value of `dog` is an object, `animals[dog]` actually means that weâre creating a new property called `"[object Object]"` equal to the new object. `animals["[object Object]"]` is now equal to `{ emoji: "đļ", name: "Mara"}`.
+āϝā§āĻšā§āϤ⧠`dog` āĻāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻ, `animals[dog]` āĻāϰ āĻŽāĻžāύ⧠āĻāĻŽāϰāĻž āĻāϏāϞ⧠āύāϤā§āύ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻ āϏāĻŽāĻžāύ āϏā§āĻ āĻāϰāĻāĻŋ `"[object Object]"` āύāĻžāĻŽā§āϰ āύāϤā§āύ āĻāĻāĻāĻŋ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĨ¤ āĻĢāϞ⧠āĻāĻāύ `animals["[object Object]"]` āĻāϰ āϏāĻŽāĻžāύ āĻšāϞ⧠`{ emoji: "đļ", name: "Mara"}`āĨ¤
-`cat` is also an object, which means that `animals[cat]` actually means that weâre overwriting the value of `animals["[object Object]"]` with the new cat properties.
+`cat`-āĻ āĻāĻāĻāĻŋ āĻ
āĻŦāĻā§āĻā§āĻ, āϝāĻžāϰ āĻŽāĻžāύ⧠āĻšāϞ⧠`animals[cat]` āĻāϏāϞ⧠`animals["[object Object]"]` āĻāϰ āĻā§āϝāĻžāϞā§āĻā§ āĻāĻāĻžāϰāϰāĻžāĻāĻĄ āĻāϰāĻž āĻšā§ā§āĻā§ āύāϤā§āύ cat āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻĻāĻŋā§ā§ āĻ
āϰā§āĻĨāĻžā§ `animals["[object Object]"]` āϏāĻŽāĻžāύ āĻāĻāύ `{ emoji: "đ", name: "Sara" }`āĨ¤
-Logging `animals[dog]`, or actually `animals["[object Object]"]` since converting the `dog` object to a string results `"[object Object]"`, returns the `{ emoji: "đ", name: "Sara" }`.
+`animals[dog]` āĻā§ āϞāĻ āĻāϰāĻž, āĻāϏāϞ⧠`animals["[object Object]"]` āĻā§āĻ āϞāĻ āĻāϰāĻž āϝā§āĻšā§āϤ⧠`dog` āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āϏā§āĻā§āϰāĻŋāĻ āĻ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāϞ⧠āĻĒāĻžāĻā§āĻž āϝāĻžā§ `"[object Object]"` āϝā§āĻāĻž āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠`{ emoji: "đ", name: "Sara" }`āĨ¤
From 142843e48cbabbce7eb7f3afbf4cb3b4f5bd3469 Mon Sep 17 00:00:00 2001
From: iamsaief
Date: Tue, 23 Jul 2024 06:12:37 +0600
Subject: [PATCH 12/12] =?UTF-8?q?added=20translation=20till=20155,=20the?=
=?UTF-8?q?=20end=20=F0=9F=8E=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
bn-BD/README_bn-BD.md | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/bn-BD/README_bn-BD.md b/bn-BD/README_bn-BD.md
index 4ac18dad..b170d6e9 100644
--- a/bn-BD/README_bn-BD.md
+++ b/bn-BD/README_bn-BD.md
@@ -441,7 +441,7 @@ console.log(sarah);
---
-###### 13. What are the three phases of event propagation?
+###### 13. āĻāĻā§āύā§āĻ āĻĒā§āϰā§āĻĒāĻžāĻā§āĻļāύā§āϰ ā§ŠāĻāĻŋ āϧāĻžāĻĒ āĻāĻŋ āĻāĻŋ?
- A: Target > Capturing > Bubbling
- B: Bubbling > Target > Capturing
@@ -1373,7 +1373,7 @@ console.log(gen.next().value);
---
-###### 45. What does this return?
+###### 45. āĻāĻāĻž āĻāĻŋ āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§?
```javascript
const firstPromise = new Promise((res, rej) => {
@@ -5018,7 +5018,7 @@ console.log(user.email);
#### āĻāϤā§āϤāϰ: A
-The `updateEmail` function is an arrow function, and is not bound to the `user` object. This means that the `this` keyword is not referring to the `user` object, but refers to the global scope in this case. The value of `email` within the `user` object does not get updated. When logging the value of `user.email`, the original value of `my@email.com` gets returned.
+āĻāĻāĻžāύ⧠`updateEmail` āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āĻĢāĻžāĻāĻļāύ, āĻāĻŦāĻ āĻāϰ āϏā§āĻā§āĻĒ `user` āĻ
āĻŦāĻā§āĻā§āĻā§ āĻŦāĻžāϧā§āϝ āύā§āĨ¤ āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ⧠āϝ⧠`this` āĻā§āĻā§āĻžāϰā§āĻĄāĻāĻŋ `user` āĻ
āĻŦāĻā§āĻā§āĻāĻā§ āϰā§āĻĢāĻžāϰ āĻāϰāĻā§ āύāĻž, āĻŦāϰāĻ āĻāĻā§āώā§āϤā§āϰ⧠āĻā§āϞā§āĻŦāĻžāϞ āϏā§āĻā§āĻĒāĻā§ āϰā§āĻĢāĻžāϰ āĻāϰāĻā§āĨ¤ `user` āĻ
āĻŦāĻā§āĻā§āĻā§āϰ `email` āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻšāĻā§āĻā§ āύāĻžāĨ¤ āĻĢāϞ⧠āϝāĻāύ `user.email`-āĻāϰ āĻā§āϝāĻžāϞā§āĻā§ āϞāĻ āĻāϰāĻž āĻšā§ā§āĻā§, āĻāϏāϞ āĻā§āϝāĻžāϞā§āĻāĻŋāĻ-`my@email.com` āϰāĻŋāĻāĻžāϰā§āύ āĻšā§ā§āĻā§āĨ¤
@@ -5054,14 +5054,14 @@ runPromises()
#### āĻāϤā§āϤāϰ: D
-The `Promise.all` method runs the passed promises in parallel. If one promise fails, the `Promise.all` method _rejects_ with the value of the rejected promise. In this case, `promise3` is rejected with the value `"Third"`. Weâre catching the rejected value in the chained `catch` method on the `runPromises` invocation to catch any errors within the `runPromises` function. Only `"Third"` gets logged, since `promise3` is rejected with this value.
+`Promise.all` āĻŽā§āĻĨāĻĄāĻāĻŋ āĻĒāĻžāϏ āĻāϰāĻž āϏāĻāϞ āĻĒā§āϰāĻŽāĻŋāϏāĻā§āϞā§āĻā§ āϏāĻŽāĻžāύā§āϤāϰāĻžāϞāĻāĻžāĻŦā§/āĻāĻāĻ āϏāĻžāĻĨā§ āϰāĻžāύ āĻāϰā§āĨ¤ āϝāĻĻāĻŋ āĻāĻāĻāĻž āĻĒā§āϰāĻŽāĻŋāϏ āĻĢā§āĻāϞ āĻāϰā§, `Promise.all` āĻŽā§āĻĨāĻĄ āϰāĻŋāĻā§āĻā§āĻ āĻāϰāĻž āĻĒā§āϰāĻŽāĻŋāϏā§āϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻĻāĻŋā§ā§ _āϰāĻŋāĻā§āĻā§āĻ_ āĻāϰāĻŦā§āĨ¤ āĻāĻā§āώā§āϤā§āϰā§, `promise3` āϰāĻŋāĻā§āĻā§āĻ āĻšā§ā§āĻā§ `"Third"` āĻā§āϝāĻžāϞā§āĻāĻŋ āĻĻāĻŋā§ā§āĨ¤ āĻāĻŽāϰāĻž āĻāĻ āϰāĻŋāĻā§āĻā§āĻ āĻā§āϝāĻžāϞā§āĻāĻŋāĻ āĻā§āϝāĻžāĻ āĻāϰāĻāĻŋ āĻā§āĻāύ `.catch` āĻŽā§āĻĨāĻĄā§ āϝāĻāύ `runPromises` āĻāϞāĻžāϰ āϏāĻŽā§ āĻāĻ āĻĢāĻžāĻāĻļāύā§āϰ āĻā§āύ āĻāϰāϰ āĻā§āϝāĻžāĻ āĻāϰāĻāĻŋāĨ¤ āĻā§āĻŦāϞ `"Third"`-āĻ āϞāĻ āĻšā§ā§āĻā§, āϝā§āĻšā§āϤ⧠`promise3` āϰāĻŋāĻā§āĻā§āĻ āĻšā§ā§āĻā§ `"Third"` āĻā§āϝāĻžāϞā§āĻāĻŋ āĻĻāĻŋā§ā§āĨ¤
---
-###### 153. What should the value of `method` be to log `{ name: "Lydia", age: 22 }`?
+###### 153. `{ name: "Lydia", age: 22 }` āϞāĻ āĻāϰāĻž āĻāύā§āϝ `method` āĻāϰ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻŋ āĻšāĻā§āĻž āĻāĻāĻŋā§?
```javascript
const keys = ["name", "age"];
@@ -5086,9 +5086,9 @@ const method =
#### āĻāϤā§āϤāϰ: C
-The `fromEntries` method turns a 2d array into an object. The first element in each subarray will be the key, and the second element in each subarray will be the value. In this case, weâre mapping over the `keys` array, which returns an array that the first element is the item on the key array on the current index, and the second element is the item of the values array on the current index.
+`fromEntries` āĻŽā§āĻĨāĻĄāĻāĻŋ āĻāĻāĻāĻŋ 2D āĻ
ā§āϝāĻžāϰā§āĻā§ āĻ
āĻŦāĻā§āĻā§āĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰā§āĨ¤ āĻĒā§āϰāϤāĻŋāĻāĻŋ āϏāĻžāĻŦ-āĻ
ā§āϝāĻžāϰā§āϰ ā§§āĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻāĻāĻŋ āĻšāĻŦā§ āύāĻŋāϰā§āĻĻāĻŋāώā§āĻ āĻāĻŋ āĻāĻŦāĻ ā§¨ā§ āĻāϞāĻŋāĻŽā§āύā§āĻāĻāĻŋ āĻšāĻŦā§ āĻāĻ āĻāĻŋ-āĻāϰ āĻā§āϝāĻžāϞā§āĨ¤ āĻāĻā§āώā§āϤā§āϰā§, āĻāĻŽāϰāĻž `keys` āĻ
ā§āϝāĻžāϰā§āϰ āĻāĻĒāϰ āĻŽā§āϝāĻžāĻĒ āĻāĻžāϞāĻžāĻā§āĻāĻŋ, āϝā§āĻāĻž āĻāĻŽāύ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āϰāĻŋāĻāĻžāϰā§āύ āĻāϰ⧠āϝāĻžāϰ ā§§āĻŽ āĻāϞāĻŋāĻŽā§āύā§āĻāĻāĻŋ āĻšā§ āĻŦāϰā§āϤāĻŽāĻžāύ āĻāύāĻĄā§āĻā§āϏā§āϰ āĻāύā§āϝ āĻāĻŋ-āĻ
ā§āϝāĻžāϰā§āϰ āĻāĻāĻā§āĻŽ, āĻāĻŦāĻ ā§¨ā§ āĻāϞāĻŋāĻŽā§āύā§āĻāĻāĻŋ āĻšā§ āĻŦāϰā§āϤāĻŽāĻžāύ āĻāύāĻĄā§āĻā§āϏā§āϰ āĻāύā§āϝ āĻā§āϝāĻžāϞā§-āĻ
ā§āϝāĻžāϰā§āϰ āĻāĻāĻā§āĻŽāĨ¤
-This creates an array of subarrays containing the correct keys and values, which results in `{ name: "Lydia", age: 22 }`
+āĻāĻāĻž āϏāĻžāĻŦ-āĻ
ā§āϝāĻžāϰā§āĻā§āϞā§āϰ āĻāĻāĻāĻŋ āĻ
ā§āϝāĻžāϰ⧠āϤā§āϰāĻŋ āĻāϰ⧠āϝā§āĻāĻžāϤ⧠āϏāĻ āĻŋāĻ āĻāĻŋ-āĻā§āϝāĻžāϞ⧠āĻā§āϞ⧠āĻĨāĻžāĻā§, āĻāĻāĻžāϰāĻ āĻĢāϞāĻžāĻĢāϞ āĻšā§ā§āĻā§ `{ name: "Lydia", age: 22 }`
@@ -5122,7 +5122,7 @@ console.log(member);
#### āĻāϤā§āϤāϰ: C
-The default value of `address` is an empty object `{}`. When we set the variable `member` equal to the object returned by the `createMember` function, we didn't pass a value for the address, which means that the value of the address is the default empty object `{}`. An empty object is a truthy value, which means that the condition of the `address ? address : null` conditional returns `true`. The value of the address is the empty object `{}`.
+āĻāĻāĻžāύ⧠`address` āĻāϰ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞ⧠āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻāĻž āĻ
āĻŦāĻā§āĻā§āĻ `{}`āĨ¤ āϝāĻāύ āĻāĻŽāϰāĻž `member` āĻā§āϝāĻžāϰāĻŋā§ā§āĻŦāϞāĻā§ āϏā§āĻ āĻāϰāĻāĻŋ `createMember` āĻĢāĻžāĻāĻļāύā§āϰ āϰāĻŋāĻāĻžāϰā§āύ āĻā§āϝāĻžāϞā§āϰ āϏāĻŽāĻžāύ, āĻāĻŽāϰāĻž address āĻāϰ āĻā§āύ āĻā§āϝāĻžāϞ⧠āĻĒāĻžāϏ āĻāϰāĻŋāύāĻŋ, āĻāϰ āĻŽāĻžāύ⧠āĻšāϞ⧠āϝ⧠`address` āĻāϰ āĻā§āϝāĻžāϞ⧠āĻĨāĻžāĻāĻā§ āϤāĻžāϰ āĻĄāĻŋāĻĢāϞā§āĻ āĻā§āϝāĻžāϞ⧠āĻĢāĻžāĻāĻāĻž āĻ
āĻŦāĻā§āĻā§āĻ `{}`āĨ¤ āĻāϰ āĻĢāĻžāĻāĻāĻž āĻ
āĻŦāĻā§āĻā§āĻ āĻāĻāĻāĻŋ āĻā§āϰā§āĻĨāĻŋ āĻā§āϝāĻžāϞā§, āϝāĻžāϰ āĻŽāĻžāύ⧠`address ? address : null`-āĻāύā§āĻĄāĻŋāĻļāύāĻžāϞ āĻāϰ āĻļāϰā§āϤāĻāĻŋ `true` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰāĻā§āĨ¤ `address` āĻāϰ āĻā§āϝāĻžāϞ⧠āĻĢāĻžāĻāĻāĻž āĻ
āĻŦāĻā§āĻā§āĻ `{}`, āĻĢāϞ⧠`{ email: "my@email.com", address: {} }` āϞāĻ āĻšā§ā§āĻā§āĨ¤
@@ -5152,9 +5152,9 @@ if (!typeof randomValue === "string") {
#### āĻāϤā§āϤāϰ: B
-The condition within the `if` statement checks whether the value of `!typeof randomValue` is equal to `"string"`. The `!` operator converts the value to a boolean value. If the value is truthy, the returned value will be `false`, if the value is falsy, the returned value will be `true`. In this case, the returned value of `typeof randomValue` is the truthy value `"number"`, meaning that the value of `!typeof randomValue` is the boolean value `false`.
+āĻāĻāĻžāύ⧠`if` āϏā§āĻā§āĻāĻŽā§āύā§āĻā§āϰ āĻļāϰā§āϤāĻāĻŋ āĻā§āĻ āĻāϰāĻā§ `!typeof randomValue`-āĻāϰ āĻā§āϝāĻžāϞ⧠āϏāĻŽāĻžāύ `"string"` āĻšā§ āĻāĻŋāύāĻžāĨ¤ `!` āĻ
āĻĒāĻžāϰā§āĻāϰāĻāĻŋ āĻā§āϝāĻžāϞā§āĻāĻŋāĻā§ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰ⧠āĻāĻāĻāĻŋ āĻŦā§āϞāĻŋā§āĻžāύ āĻā§āϝāĻžāϞā§āϤā§āĨ¤ āϝāĻĻāĻŋ āĻā§āϝāĻžāϞā§āĻāĻŋ _āĻā§āϰā§āĻĨāĻŋ_ āĻšā§, āϰāĻŋāĻāĻžāϰā§āύ āĻā§āϝāĻžāϞ⧠āĻšāĻŦā§ `false`, āϝāĻĻāĻŋ āĻā§āϝāĻžāϞā§āĻāĻŋ _āĻĢāϞāϏāĻŋ_ āĻšā§, āϰāĻŋāĻāĻžāϰā§āύ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻšāĻŦā§ `true`āĨ¤ āĻāĻā§āώā§āϤā§āϰā§, `typeof randomValue`-āĻāϰ āϰāĻŋāĻāĻžāϰā§āύ āĻā§āϝāĻžāϞ⧠āĻšā§ `"number"`-āĻāϰ āĻā§āϰā§āĻĨāĻŋ āĻā§āϝāĻžāϞā§, āĻŽāĻžāύ⧠āĻšāϞ⧠āϝ⧠`!typeof randomValue`-āĻāϰ āĻā§āϝāĻžāϞ⧠āĻšā§ āĻŦā§āϞāĻŋā§āĻžāύ `false` āĻā§āϝāĻžāϞā§āĨ¤
-`!typeof randomValue === "string"` always returns false, since we're actually checking `false === "string"`. Since the condition returned `false`, the code block of the `else` statement gets run, and `Yay it's a string!` gets logged.
+`!typeof randomValue === "string"` āϏāĻŦāϏāĻŽā§ `false` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§, āϝā§āĻšā§āϤ⧠āĻāĻŽāϰāĻž āĻāϏāϞ⧠āĻā§āĻ āĻāϰāĻāĻŋ `false === "string"` āĻāĻŋāύāĻžāĨ¤ āĻĢāϞ⧠āĻļāϰā§āϤāĻāĻŋ `false` āϰāĻŋāĻāĻžāϰā§āύ āĻāϰā§, `else` āϏā§āĻā§āĻāĻŽā§āύā§āĻā§āϰ āĻā§āĻĄ āĻŦā§āϞāĻāĻāĻŋ āϰāĻžāύ āĻšā§, āĻāĻŦāĻ `Yay it's a string!` āϞāĻ āĻšā§āĨ¤