Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for How can I convert a comma-separated string to an array?

Current License: CC BY-SA 4.0

10 events
when toggle format what by license comment
Feb 2, 2024 at 19:09 history edited Inigo CC BY-SA 4.0
make it a literal answer to the question, also avoid confusion with the class name`String`.
S Mar 31, 2023 at 4:56 history suggested Community Bot CC BY-SA 4.0
MDN reference link uses const,, and var is out-dated.
Mar 31, 2023 at 2:32 review Suggested edits
S Mar 31, 2023 at 4:56
Mar 24, 2020 at 4:58 comment added Gabriel Linassi a way of solving empty string element when ''.split(',') === [''] is filtering string.split(',').filter(e => e !== '')
Aug 2, 2016 at 15:49 comment added Vlad Goran While split will work fine if you are sure you have elements in array, if you're expecting data from a server / database you will run into trouble since ''.split(',') has a length === 1 IE: ''.split(',') === ['']
May 19, 2015 at 20:47 history rollback Matchu
Rollback to Revision 2
Apr 2, 2015 at 21:45 history edited Seybsen CC BY-SA 3.0
fixed typo
Jun 17, 2013 at 9:05 history edited Matchu CC BY-SA 3.0
added 272 characters in body
May 18, 2010 at 14:48 vote accept Blankman
May 18, 2010 at 14:24 history answered Matchu CC BY-SA 2.5

AltStyle によって変換されたページ (->オリジナル) /