Is it useful?

Report a typo

In the code below, there is a function called isItUseful. It will be passed some different variations of a string, including those shown below:

'RegExp is very useful!'
'RegExp is very useful.'

Pay attention to the final characters — each string ends with a different punctuation mark.

Your task is to create a pattern that matches this string, regardless of the punctuation mark at the end.

You don't need to call the function; just return the result.

Sample Input 1:

RegExp is very useful!

Sample Output 1:

true
Write a program in JavaScript
function isItUseful(string) {

}
___

Create a free account to access the full topic