I want to convert the following string \'14 2\' into an array of two integers. How can I do it ?
\'14 2\'
Just for fun I thought I'd throw a forEach(f()) solution in too.
forEach(f())
var a=[]; "14 2".split(" ").forEach(function(e){a.push(parseInt(e,10))}); // a = [14,2]