var fn = function(/* whoa) */ hi, you){}; fn.toString() .replace(/((//.*$)|(/*[sS]*?*/)|(s))/mg,'') .match(/^functions*[^(]*(s*([^)]*))/m)[1] .split(/,/) ["hi", "you"]