Frontend
Interviews
.dev
Problems
686. RegExp.test Global lastIndex Wrap
Easy
•
...
Predict the output.
const
r
=
/
a
/
g
console
.
log
(
r
.
test
(
'a'
)
,
r
.
test
(
'a'
)
,
r
.
lastIndex
)
What is printed in the console?
true true 1
true false 0
false true 1
true false 1
Submit Answer
Reveal Answer
Select an option and submit your answer.
Next Problem
Auto-advance on correct answer