Q. Consider the following statements var text = "testing: 1, 2, 3"; // Sample text var pattern = /\d+/g In order to check if the pattern matches with the string “text”, the statement is (Solved)

1. text==pattern

2. pattern.test(text)

3. text.test(pattern)

4. text.equals(pattern)

  • b. pattern.test(text)
Subscribe Now

Get All Updates & News