What Will Be The Purpose Of Exec In The Following Javascript #205

What will be the purpose of exec() in the following JavaScript code?</p> <pre><code class="language-javascript"> var pattern = /Java/g; var text = "JavaScript is more fun than Java!"; var result; while ((result = pattern.exec(text)) != null) { alert("Matched '" + result[0] + "'" +" at position " + result.index +"; next search begins at " + pattern.lastIndex); } </code></pre>

Online Quiz This multiple choice question (MCQ) is related to the book/course gs gs106 Javascript. It can also be found in gs gs106 Classes and Modules - JavaScript Pattern Matching and Regular Expressions - Quiz No.1.


Similar question(s) are as followings:



Online Quizzes of gs106 Javascript

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background