I have below string -
var a = \"1,2,3,4\";
when I do -
var b = a.split(\',\');
I get b as
b
One liner
Array.from(a.split(','), Number)