I have a one-dimensional array of integer in JavaScript that I\'d like to add data from comma separated string, Is there a simple way to do this?
e.g : var strVale
var strVale
just you need to use couple of methods for this, that's it!
var strVale = "130,235,342,124"; var resultArray = strVale.split(',').map(function(strVale){return Number(strVale);});
the output will be the array of numbers.