| Viewed 107 times

How I should convert a string into an Array in JavaScript?


I need a function that turns a comma-delimited list into an array of strings. Examples toArray("watermelon, raspberry, orange") // ["raspberry", "orange"]