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 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: b
Explanation: 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.

Join The Discussion