Examveda
Examveda

What would be the result of the following statement in JavaScript using regular expression methods ?

A. Returns [“123″”456″”789”]

B. Returns [“123″,”456″,”789”]

C. Returns [1,2,3,4,5,6,7,8,9]

D. Throws an exception

Answer: Option B

Solution(By Examveda Team)

The split() method can take regular expressions as its arguments. The split() method generally breaks the string on which it is called into an array of substrings, using the argument as a separator.

This Question Belongs to Javascript >> Classes And Modules

Join The Discussion

Related Questions on Classes and Modules