Skip to content

Instantly share code, notes, and snippets.

@1337
Created May 26, 2014 20:15
Show Gist options
  • Save 1337/b0d460eaa9736af992b6 to your computer and use it in GitHub Desktop.
Save 1337/b0d460eaa9736af992b6 to your computer and use it in GitHub Desktop.
// 1. [ ] how is "foo = function foo" from "foo = function"?
// 2. [ ] what happens when you do "function foo(foo)"?
var func = function func(func) {
// 3. [ ] what happens when you do "var foo" in a "function(foo)"?
var func;
// 4. [ ] what is "typeof func" here?
console.log(typeof func);
};
// 5. [ ] what happens if you "function func" after the "var func" above?
function func(func) {
console.log("func");
}
// 6. [ ] what is this "func" variable?
// 7. [ ] what is ".call"? -> what does ".call" do?
// 8. [ ] what is the second "func" (the first argument)?
// 9. [ ] what arguments do "func" get?
// 10. [ ] what if you swap ".call" with ".apply"?
func.call(func, ["func"]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment