Nguyễn Tiến Dũng
New member
Consider the following JavaScript statements.
In order to check if the pattern matches with the string “text”, the statement is ____________
A. text==pattern
B. text.equals(pattern)
C. text.test(pattern)
D. pattern.test(text)
Code:
var text = "testing: 1, 2, 3"; // Sample text
var pattern = /\d+/g // Matches all instances of one or more digits
A. text==pattern
B. text.equals(pattern)
C. text.test(pattern)
D. pattern.test(text)