Skip to content

Instantly share code, notes, and snippets.

@danprince
Created September 1, 2013 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danprince/6401736 to your computer and use it in GitHub Desktop.
Save danprince/6401736 to your computer and use it in GitHub Desktop.
String based functions
$=function(){
a=arguments
return function(){
for(k in a)
this[a[k]]=arguments[k]
c=a[a.length-1]
i=c.indexOf("$")
r=c.substr(i+1)
eval(c.substr(0,i))
return new Function("return "+r)()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment