Forked from stevekinney/1510-function-cfus.md
Last active
March 30, 2016 17:31
Revisions
-
ShannonPaige revised this gist
Mar 30, 2016 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,22 @@ # JavaScript Functions I can explain the difference between function declarations and function expressions. Yes. Declarations can get used higher than they are written, expressions can't. I can explain what the value of `this` is in a normal function. Global window I can explain what the value of `this` is when called from the context of an object. The object I can explain how to explicitly set the value of `this` in a function. .call(this, arguments) or .apply(this, [arguments]) I can explain the difference between `call` and `apply`. They allow you to explicitly define this, the only difference is that aaply takes other arguments as an array whereas call doesn't need the arguments to be in an array. I can describe an case where I might need to use `bind` to avoid polluting the global scope. Yes, when something is asyn, or calling a function from a constructor, you may need to bind the 'this' I can explain how `bind` works. Passing a function and the context of this. -
stevekinney created this gist
Mar 30, 2016 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ # JavaScript Functions I can explain the difference between function declarations and function expressions. I can explain what the value of `this` is in a normal function. I can explain what the value of `this` is when called from the context of an object. I can explain how to explicitly set the value of `this` in a function. I can explain the difference between `call` and `apply`. I can describe an case where I might need to use `bind` to avoid polluting the global scope. I can explain how `bind` works.