πŸ“Š Machine Learning
Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (B) Returns [“123″,”456″,”789”]

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.

Explanation by: Mr. Dubey
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.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
113
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
93%
Success Rate