SyntaxFix
Write A Post
Hire A Developer
Questions
A more shorter solution: map and pass the arguments to Number:
Number
var a = "1,2,3,4";_x000D_ var b = a.split(',');_x000D_ console.log(b);_x000D_ var c = b.map(Number);_x000D_ console.log(c);