1.

The method that performs the search-and-replace operation to strings for pattern matching is _______(a) searchandreplace()(b) add()(c) edit()(d) replace()This question was addressed to me during an internship interview.My doubt is from Pattern Matching and Regular Expressions topic in portion Classes and Modules in JavaScript of JavaScript

Answer»

Correct CHOICE is (d) replace()

The best I can explain: The replace() method PERFORMS a search-and-replace operation. It takes a REGULAR EXPRESSION as its first argument and a replacement STRING as its second argument.



Discussion

No Comment Found

Related InterviewSolutions