Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following JavaScript code?
Console.log(Pattern.matches(“[adf]+”, “a”));

What will be the output of the following JavaScript code?
Console.log(Pattern.matches(“[adf]+”, “a”));
a) true
b) false
c) undefined
d) 0

Answer: a
Explanation: “+” sign in regex checks for more than one time occurrence of a particular character. It returns true if a character from the set is present more than once.

Join The Discussion