Update article.md

string with backslash is "1\\2"
"1\2" is 1 and \2  
Error: Octal escape sequences are not allowed in strict mode.
without strict mode match returns null
This commit is contained in:
YNataly 2017-10-18 21:56:37 +03:00 committed by GitHub
parent ccc0e9327f
commit 38f4a7bfca

View file

@ -30,7 +30,7 @@ alert( "function g()".match(/g\(\)/) ); // "g()"
If we're looking for a backslash `\`, then we should double it: If we're looking for a backslash `\`, then we should double it:
```js run ```js run
alert( "1\2".match(/\\/) ); // '\' alert( "1\\2".match(/\\/) ); // '\'
``` ```
## A slash ## A slash