Splitting a String into an Array with split in Javascript


Convert a string into an array of substrings.

Source Code

let fruits = "apple, banana, cherry";
console.log(fruits.split(", ")); // ["apple", "banana", "cherry"]
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments