Skip to content

Commit f16bfb8

Browse files
committed
Fix typos
1 parent 14ddea5 commit f16bfb8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@
542542

543543
3. **Object's create method:**
544544

545-
The `create` method of Object is used to create a new object by passing the specificied prototype object and properties as arguments, i.e., this pattern is helpful to create new objects based on existing objects.
545+
The `create` method of Object is used to create a new object by passing the specified prototype object and properties as arguments, i.e., this pattern is helpful to create new objects based on existing objects.
546546
The second argument is optional and it is used to create properties on a newly created object.
547547

548548
The following code creates a new empty object whose prototype is null.
@@ -1035,7 +1035,7 @@
10351035

10361036
21. ### What is the Temporal Dead Zone
10371037

1038-
The Temporal Dead Zone(TDZ) is a specific period or area of a block where a variable is inaccessible until it has been intialized with a value. This behavior in JavaScript that occurs when declaring a variable with the let and const keywords, but not with var. In ECMAScript 6, accessing a `let` or `const` variable before its declaration (within its scope) causes a ReferenceError.
1038+
The Temporal Dead Zone(TDZ) is a specific period or area of a block where a variable is inaccessible until it has been initialized with a value. This behavior in JavaScript that occurs when declaring a variable with the let and const keywords, but not with var. In ECMAScript 6, accessing a `let` or `const` variable before its declaration (within its scope) causes a ReferenceError.
10391039

10401040
Let's see this behavior with an example,
10411041
@@ -6839,7 +6839,7 @@
68396839
const arr = [1, [2, 3], 4, 5, [6, 7]];
68406840
const fllattenArr = arr.flat(); // [1, 2, 3, 4, 5, 6, 7]
68416841

6842-
// And for multiDemensional arrays
6842+
// And for multiDimensional arrays
68436843
const multiDimensionalArr = [11, [22, 33], [44, [55, 66, [77, [88]], 99]]];
68446844
const oneStepFlat = multiDimensionalArr.flat(1); // [11, 22, 33, 44, [55, 66, [77, [88]], 99]]
68456845
const towStep = multiDimensionalArr.flat(2); // [11, 22, 33, 44, 55, 66, [77, [88]], 99]
@@ -7795,7 +7795,7 @@
77957795
77967796
422. ### Is that possible to use expressions in switch cases?
77977797
7798-
You might have seen expressions used in switch condition but it is also possible to use for switch cases by assigning true value for the switch condition. Let's see the weather condition based on temparature as an example,
7798+
You might have seen expressions used in switch condition but it is also possible to use for switch cases by assigning true value for the switch condition. Let's see the weather condition based on temperature as an example,
77997799
78007800
```js
78017801
const weather = (function getWeather(temp) {
@@ -8294,7 +8294,7 @@
82948294
| ----------------------------------- | --------------------------------------------------------------------- |
82958295
| It has no side effects | It causes side effects |
82968296
| It is always return the same result | It returns different result on each call |
8297-
| Easy to read and debug | Difficult to read and debug because they are affected by extenal code |
8297+
| Easy to read and debug | Difficult to read and debug because they are affected by external code |
82988298
82998299
**[⬆ Back to Top](#table-of-contents)**
83008300
@@ -8515,7 +8515,7 @@ The execution context is created when a function is called. The function's code
85158515
85168516
455. ### What are the benefits higher order functions?
85178517
The main benefits of higher order functions are:
8518-
1. Abstration
8518+
1. Abstraction
85198519
2. Reusability
85208520
3. Immutability
85218521
4. Modularity
@@ -10622,7 +10622,7 @@ console.log("🙂" === "🙂");
1062210622
1062310623
##### Answer: 2
1062410624
10625-
Emojis are unicodes and the unicode for smile symbol is "U+1F642". The unicode comparision of same emojies is equivalent to string comparison. Hence, the output is always true.
10625+
Emojis are unicodes and the unicode for smile symbol is "U+1F642". The unicode comparison of same emojies is equivalent to string comparison. Hence, the output is always true.
1062610626
1062710627
</p>
1062810628
@@ -10837,7 +10837,7 @@ var getMessage = () => {
1083710837
1083810838
##### Answer: 2
1083910839
10840-
Hoisting will move variables and functions to be the top of scope. Even though getMessage is an arrow function the above function will considered as a varible due to it's variable declaration or assignment. So the variables will have undefined value in memory phase and throws an error '`getMessage` is not a function' at the code execution phase.
10840+
Hoisting will move variables and functions to be the top of scope. Even though getMessage is an arrow function the above function will considered as a variable due to it's variable declaration or assignment. So the variables will have undefined value in memory phase and throws an error '`getMessage` is not a function' at the code execution phase.
1084110841
1084210842
</p>
1084310843
@@ -11183,7 +11183,7 @@ changeCurrentCity();
1118311183
1118411184
##### Answer: 3
1118511185
11186-
Due to hositing feature, the variables declared with `var` will have `undefined` value in the creation phase so the outer variable `currentCity` will get same `undefined` value. But after few lines of code JavaScript engine found a new function call(`changeCurrentCity()`) to update the current city with `var` re-declaration. Since each function call will create a new execution context, the same variable will have `undefined` value before the declaration and new value(`Singapore`) after the declarion. Hence, the value `undefined` print first followed by new value `Singapore` in the execution phase.
11186+
Due to hositing feature, the variables declared with `var` will have `undefined` value in the creation phase so the outer variable `currentCity` will get same `undefined` value. But after few lines of code JavaScript engine found a new function call(`changeCurrentCity()`) to update the current city with `var` re-declaration. Since each function call will create a new execution context, the same variable will have `undefined` value before the declaration and new value(`Singapore`) after the declaration. Hence, the value `undefined` print first followed by new value `Singapore` in the execution phase.
1118711187
1118811188
</p>
1118911189
</details>
@@ -11502,8 +11502,8 @@ const promiseTwo = new Promise((resolve, reject) => setTimeout(reject, 4000));
1150211502
Promise.all([promiseOne, promiseTwo]).then((data) => console.log(data));
1150311503
```
1150411504
11505-
- 1: [{status: "fullfilled", value: undefined}, {status: "rejected", reason: undefined}]
11506-
- 2: [{status: "fullfilled", value: undefined}, Uncaught(in promise)]
11505+
- 1: [{status: "fulfilled", value: undefined}, {status: "rejected", reason: undefined}]
11506+
- 2: [{status: "fulfilled", value: undefined}, Uncaught(in promise)]
1150711507
- 3: Uncaught (in promise)
1150811508
- 4: [Uncaught(in promise), Uncaught(in promise)]
1150911509
@@ -11789,7 +11789,7 @@ func();
1178911789
1179011790
##### Answer: 1
1179111791
11792-
If a function is called with `undefined`, the `undefined` value is treated as a parameter. But if the function is not passed with any parameters, the `arguments` object doesn't include any argument eventhough the function has default function parameter. Hence, the function invocation with `undefined` has one argument and function call without any arguments has 0 agruments.
11792+
If a function is called with `undefined`, the `undefined` value is treated as a parameter. But if the function is not passed with any parameters, the `arguments` object doesn't include any argument eventhough the function has default function parameter. Hence, the function invocation with `undefined` has one argument and function call without any arguments has 0 arguments.
1179311793
1179411794
</p>
1179511795
</details>

0 commit comments

Comments
 (0)