Skip to content

Commit 9a7deae

Browse files
committed
fix
1 parent ce41196 commit 9a7deae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ alert( ~-1 ); // 0, the same as -(-1+1)
322322
*/!*
323323
```
324324

325-
As we can see, for 32-bit integers `~n` is zero only if `n == -1`.
325+
As we can see, `~n` is zero only if `n == -1` (that's for any 32-bit signed integer `n`).
326326

327327
So, the test `if ( ~str.indexOf("...") )` is truthy only if the result of `indexOf` is not `-1`. In other words, when there is a match.
328328

0 commit comments

Comments
 (0)