πŸ“Š JavaScript
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()
πŸ’¬ Discuss
βœ… Correct Answer: (B) split()

Explanation: 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!

Explanation by: Yogesh
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!

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
179
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Yogesh
Publisher
πŸ“ˆ
86%
Success Rate