Declaration in question:
let foo = { bar () {} };
{ bar: [Function: bar] }
This creates an object with a single property bar
that is an arrow function and assigns it to foo
.
So { bar: () => {} }
is this { bar () {} }
?
Can someone explain/expand on this?
Anyone have a reference to documentation on this?
Is there a term for this kind of declaration (that I can Google)?
Other than saving some keystrokes, any reason to use this kind of declaration?