Created
July 7, 2015 13:22
-
-
Save johnantoni/a409b682f0abe46391ea to your computer and use it in GitHub Desktop.
javascript function types
This file contains hidden or 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 characters
// self invoking | |
(function () { | |
var x = "Hello!!"; // I will invoke myself | |
})(); | |
// functions as values | |
function myFunction(a, b) { | |
return a * b; | |
} | |
var x = myFunction(4, 3); | |
// functions as objects | |
function myFunction(a, b) { | |
return a * b; | |
} | |
var txt = myFunction.toString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment