FrontendInterviews.dev

685. RegExp.test Non-global lastIndex

Easy•

Predict the output.

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

What is printed in the console?

Select an option and submit your answer.
Next Problem