I have below string –

var a = "1,2,3,4";

when I do –

var b = a.split(',');

I get b as ["1", "2", "3", "4"]

can I do something to get b as [1, 2, 3, 4] ?

18 Answers
18

Leave a Reply

Your email address will not be published. Required fields are marked *