1.

What does the subexpression /java(script)?/ result in?(a) It matches “java” followed by the optional “script”(b) It matches “java” followed by any number of “script”(c) It matches “java” followed by a minimum of one “script”(d) It matches “java” followed by a single “script”I have been asked this question during an online exam.This interesting question is from Pattern Matching and Regular Expressions topic in portion Classes and Modules in JavaScript of JavaScript

Answer»

Right CHOICE is (a) It matches “java” followed by the optional “SCRIPT

For explanation: PARANTHESIS () CHECK for the optional presence of the argument in the STRING. subexpression /java(script)?/ matches “java” followed by the optional “script”.



Discussion

No Comment Found

Related InterviewSolutions