Home / Javascript Tips Generated By ChatGPT / 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"]