News for hackers. Stuff that matters.
Re:JavaScript: generating a function with runtime data from ... by sigilworks on Thursday March 20, 2014 @11:17AM (#7436025)
I think there are some errors in the final solution code, as it doesn't do what you describe.

Were you aiming at something like this?

var generated = function(value) { return new Function( "return (" + function(valueToSwap) { return { prop: valueToSwap }; } + ")(" + value + ");" ); };

Re:JavaScript: generating a function with runtime data from ... by lutusp on Tuesday March 18, 2014 @12:58PM (#7423151)
It's called "regression analysis". Nothing to see here, move along. :)
Re:JavaScript: generating a function with runtime data from ... by tsenkov on Tuesday March 18, 2014 @02:08PM (#7423782)
I don't get it, what is?
Re:JavaScript: generating a function with runtime data from ... by lutusp on Tuesday March 18, 2014 @02:19PM (#7423857)
Using a data set to create a function able to produce that data set.

http://en.wikipedia.org/wiki/Regression_analysis