Discussion :: Javascript - CS
- 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
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.
Be The First To Comment