Created
September 27, 2018 15:13
-
-
Save binki/fce88551d19a6adbf55b495b70adbb6f to your computer and use it in GitHub Desktop.
Demonstrate regExp.lastIndex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> process.version | |
'v8.12.0' | |
> const re = /a/g | |
undefined | |
> re.lastIndex | |
0 | |
> re.test('asdf') | |
true | |
> re.lastIndex | |
1 | |
> re.test('assert') | |
false | |
> re.lastIndex | |
0 | |
> re.test('assert') | |
true | |
> re.lastIndex | |
1 | |
> re.test('assert') | |
false | |
> re.lastIndex | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment