Sail E0 Webinar
Question
Consider the following statementsvar text = "testing: 1, 2, 3"; // Sample textvar pattern = /\d+/g // Matches all instances of one or more digitsIn order to check if the pattern matches with the string "text, the statement is
Options:
A .  text==pattern
B .  text.equals(pattern)
C .  text.test(pattern)
D .  pattern.test(text)
Answer: Option D


The given pattern is applied on the text given in the parenthesis.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers