filmov
tv
javascript - How can I convert a comma-separated string to an array?
Показать описание
#short
#javascript
#string
#csv
#split
I have a comma-separated string that I want to convert into an array, so I can loop through it.
Is there anything built-in to do this?
For example, I have this string
var str = "January,February,March,April,May,June,July,August,September,October,November,December";
Now I want to split this by the comma, and then store it in an array.
#javascript
#string
#csv
#split
I have a comma-separated string that I want to convert into an array, so I can loop through it.
Is there anything built-in to do this?
For example, I have this string
var str = "January,February,March,April,May,June,July,August,September,October,November,December";
Now I want to split this by the comma, and then store it in an array.