Skip to content

Commit 176e5f8

Browse files
authored
Fix typos in 1.5.3
1 parent 6c6a7b5 commit 176e5f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

1-js/05-data-types/03-string/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ alert( 'I*!*\'*/!*m the Walrus!' ); // *!*I'm*/!* the Walrus!
110110

111111
As you can see, we have to prepend the inner quote by the backslash `\'`, because otherwise it would indicate the string end.
112112

113-
Of course, only to the quotes that are the same as the enclosing ones need to be escaped. So, as a more elegant solution, we could switch to double quotes or backticks instead:
113+
Of course, only the quotes that are the same as the enclosing ones need to be escaped. So, as a more elegant solution, we could switch to double quotes or backticks instead:
114114

115115
```js run
116116
alert( `I'm the Walrus!` ); // I'm the Walrus!
@@ -345,7 +345,7 @@ It is usually not recommended to use language features in a non-obvious way, but
345345

346346
Just remember: `if (~str.indexOf(...))` reads as "if found".
347347

348-
To be precise though, as big numbers are truncated to 32 bits by `~` operator, there exist other numbers that give `0`, the smallest is `~4294967295=0`. That makes such check is correct only if a string is not that long.
348+
To be precise though, as big numbers are truncated to 32 bits by `~` operator, there exist other numbers that give `0`, the smallest is `~4294967295=0`. That makes such check correct only if a string is not that long.
349349

350350
Right now we can see this trick only in the old code, as modern JavaScript provides `.includes` method (see below).
351351

0 commit comments

Comments
 (0)