FrontendInterviews.dev

639. RegExp global lastIndex State

Easy•

Predict the output.

const r = /a/g
console.log(r.test('a'), r.test('a'))

What is the correct output/behavior?

Select an option and submit your answer.
Next Problem