Is there a way to dynamically replace by a function, similar to how
"1 2 3" => "2 4 6" (x2)
function doesn't seem to support a function for the argument.
var str = "1 2 3";
return +num * 2;