Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to get params from function js

var fn = function(/* whoa) */ hi, you){};

fn.toString()
  .replace(/((//.*$)|(/*[sS]*?*/)|(s))/mg,'')
  .match(/^functions*[^(]*(s*([^)]*))/m)[1]
  .split(/,/)

["hi", "you"]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #params #function #js
ADD COMMENT
Topic
Name
6+5 =