I have a string like 12345
and I need to explode it to [1,2,3,4,5]
. Normally, I would use split
, but there are no separators in here. I could use substr
(getting length
, making loops), but I will probably have a lot of those strings, so it may not be good for performance. What can I do?
Asked
Active
Viewed 56 times
-2

Cœur
- 37,241
- 25
- 195
- 267

Tomek Buszewski
- 7,659
- 14
- 67
- 112
-
1already answred here : http://stackoverflow.com/questions/4547609/how-do-you-get-a-string-to-a-character-array-in-javascript – Chtioui Malek Apr 03 '15 at 06:24
-
I didn't find it, but thanks! – Tomek Buszewski Apr 03 '15 at 06:25
-
@Tomek, Try with this, var myString = "123456";console.log(myString.split('')) – stanze Apr 03 '15 at 06:31