Created
June 16, 2016 08:39
-
-
Save Mizzlr/92ed9753b5c1d0ac1d1376dbba1e3dc9 to your computer and use it in GitHub Desktop.
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
// a function that take one argument x and returns itself | |
function(x) { return x;} | |
// a function that take nothing; but this will not be used | |
// naming a function is do as | |
var functionName = function (x) { // do something with x | |
return x; | |
}; | |
// also | |
function functionName(x) { //... | |
return x; | |
}; | |
// with ES6 spec for JS, the new function syntax is | |
(x) => { // do something with x | |
return x; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment