Skip to content

Instantly share code, notes, and snippets.

@ah01
Created September 10, 2014 23:43
Show Gist options
  • Save ah01/cfb69afefab8a7e10b95 to your computer and use it in GitHub Desktop.
Save ah01/cfb69afefab8a7e10b95 to your computer and use it in GitHub Desktop.
alert(typeof(f)); // --> function
function f() {}
alert(typeof(f)); // --> undefined
var f = function () {};
var f = function () {
return typeof(f);
}
var g = f;
f = 42;
alert(g()); // --> number
var f = function f() {
return typeof(f);
}
var g = f;
f = 42;
alert(g()); // --> function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment