Skip to content

Instantly share code, notes, and snippets.

@Mizzlr
Created June 16, 2016 08:39
Show Gist options
  • Save Mizzlr/92ed9753b5c1d0ac1d1376dbba1e3dc9 to your computer and use it in GitHub Desktop.
Save Mizzlr/92ed9753b5c1d0ac1d1376dbba1e3dc9 to your computer and use it in GitHub Desktop.
// 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