Skip to content

Instantly share code, notes, and snippets.

@MaximSokolov
Last active February 7, 2016 09:16
Show Gist options
  • Save MaximSokolov/a473b39c30db90e18e70 to your computer and use it in GitHub Desktop.
Save MaximSokolov/a473b39c30db90e18e70 to your computer and use it in GitHub Desktop.
/* -- Arrow function expression -- */
=>
() =>
x => x * x
params => ({foo: bar})
(p1, p2) => { return p1 + p2; }
foo = a => {}
foo = (p1, p2) =>{}
obj.foo = (p1, p2) =>{}
/* -- Rest parameter -- */
(...args) => args[0
function(a, b, ...theArgs) {}
/* -- ES6 method definitions -- */
{
foo() {},
write("){"){};
}
write("){");
/* -- Default parameters -- */
function f (a = _ => _) {}
function callSomething(thing = this.something()) { return thing }
multiply = (p1, p2=1) => p1 * p2
/* -- Comments -- */
x => /* */ {}
x =>
// abc
{}
.foo = x => /* */ {}
.foo = x =>
// abc
{}
function /* */ foo(){}
function
// abc
foo(){}
/* -- Other -- */
function(){}
function foo(){}
function*(){}
function* foo(){}
async function (){}
async function foo(){}
foo = function(){}
foo = function foo(){}
foo = function*(){}
foo = function* foo(){}
foo = async function(){}
foo = async function foo(){}
obj.foo = function(){}
obj.foo = function foo(){}
obj.foo = function*(){}
obj.foo = function* foo(){}
obj.foo = async function(){}
obj.foo = async function foo(){}
obj.prototype.foo = function(){}
obj.prototype.foo = function foo(){}
obj.prototype.foo = function*(){}
obj.prototype.foo = function* foo(){}
obj.prototype.foo = async function(){}
obj.prototype.foo = async function foo(){}
foo: function(){}
foo: function foo(){}
foo: function*(){}
foo: function* foo(){}
foo: async function (){}
foo: async function foo(){}
'foo': function(){}
'foo': function foo(){}
'foo': function*(){}
'foo': function* foo(){}
'foo': async function (){}
'foo': async function foo(){}
"foo": function(){}
"foo": function foo(){}
"foo": function*(){}
"foo": function* foo(){}
"foo": async function (){}
"foo": async function foo(){}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment