Skip to content

Instantly share code, notes, and snippets.

@sdumitriu
Created October 25, 2019 14:54
Show Gist options
  • Save sdumitriu/6b91c0dba1d7ba3875065db2d449d2b7 to your computer and use it in GitHub Desktop.
Save sdumitriu/6b91c0dba1d7ba3875065db2d449d2b7 to your computer and use it in GitHub Desktop.
A JavaScript question (hard mode)
// What does the following code return? Why?
var a = 1,
b = function a(x) {
x && a(--x);
outcome += ' tick';
};
var outcome = a;
b(2);
outcome;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment