Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function one() {console.log('one')} // named function
one();
new Array([0]).forEach(function() {console.log('two')}) // anonymous function
const three = function() {console.log('three')}; // aliased anonymous function
three();
const container = {
four: function() {console.log('four')}, // aliased anonymous function
five: () => console.log('five'), // aliased arrow function
six() { console.log('six') }, // named function
};
container.four();
container.five();
container.six();
const seven = () => console.log('seven'); // aliased arrow function
seven();
(function() {
console.log('eight');
})(); // immediately invoked function expression
(() => console.log('nine'))(); // immediately invoked arrow function expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment