Question: Write a statement that creates a RegExp object that remembers the title and last name, but does not remember the first name. Using the RegExp

Write a statement that creates a RegExp object that remembers the title and last name, but does not remember the first name. Using the RegExp object's exec() method, assign the result variable with the remembered title and last name of the string userName.

const userName = "Dr. Greg House"; // Code will also be tested with "Mr. Howard Wolowitz"

/* Your solution goes here */

console.log(result[1] + " " + result[2]);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!