A

Admin • 828.03K Points
Coach

Q. Which of the following functions of “String” object divides a String object into an array of strings by separating the string into substrings?

  • (A) slice()
  • (B) split()
  • (C) replace()
  • (D) search()
  • Correct Answer - Option(B)
  • Views: 8
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin
split() – Splits a String object into an array of strings by splitting the string into substrings. Example:

var str = "Hello world!";
var res = str.split(" "); //Hello,world!

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.