Home » JavaScript » JavaScript Operators » Question
  1. Consider the following statements.
    var t= "Example: 4, 5, 6"; // text
    var p = /\d+/g // Matches all instances of one or more digits

    In order to check if the pattern matches with the string “t”, the statement is
    1. p.test(t)
    2. t.test(p)
    3. t.equals(p)
    4. t==p
    5. None of these
Correct Option: A

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



Your comments will be displayed only after manual approval.