Skip to content

Commit 99f0e03

Browse files
authored
Some typos fixed
1 parent a334cbc commit 99f0e03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

en-EN/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,7 @@ function getName(name) {
27182718

27192719
#### Answer: A
27202720

2721-
With `!!name`, we determine whether the value of `name` is truthy or falsey. If name is truthy, which we want to test for, `!name` returns `false`. `!false` (which is what `!!name` practically is) returns `true`.
2721+
With `!!name`, we determine whether the value of `name` is truthy or falsy. If name is truthy, which we want to test for, `!name` returns `false`. `!false` (which is what `!!name` practically is) returns `true`.
27222722

27232723
By setting `hasName` equal to `name`, you set `hasName` equal to whatever value you passed to the `getName` function, not the boolean value `true`.
27242724

@@ -3121,7 +3121,7 @@ The `getList` function receives an array as its argument. Between the parenthese
31213121

31223122
`[x, ...y] = [1, 2, 3, 4]`
31233123

3124-
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, containig 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.
3124+
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.
31253125

31263126
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 return an _object_ from an arrow function, you have to write it between parentheses, otherwise no value gets returned! The following function would have returned an object:
31273127

@@ -3154,7 +3154,7 @@ console.log(name())
31543154

31553155
The variable `name` holds the value of a string, which is not a function, thus cannot invoke.
31563156

3157-
TypeErrors get thrown wehn 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!
3157+
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!
31583158

31593159
SyntaxErrors get thrown when you've written something that isn't valid JavaScript, for example when you've written the word `return` as `retrun`.
31603160
ReferenceErrors get thrown when JavaScript isn't able to find a reference to a value that you're trying to access.

0 commit comments

Comments
 (0)