Skip to content

Instantly share code, notes, and snippets.

@monolithed
Created September 2, 2015 10:29
Show Gist options
  • Select an option

  • Save monolithed/9c0db4f3932d6713f9d3 to your computer and use it in GitHub Desktop.

Select an option

Save monolithed/9c0db4f3932d6713f9d3 to your computer and use it in GitHub Desktop.
Lazy evaluation
var fn = function (x) { return x; }
var test = function (x) {
var a = fn(x);
test = function (x) {
return a + x;
}
return test.apply(this, arguments);
}
test(1); // 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment