Arrow function CODE
Regular anonymous function:
// Anonymous function
document.addEventListener('click', function(){
  console.log('You clicked me!');
})
The same function with arrow function syntax
// Arrow function
document.addEventListener('click', () => {
  console.log('You clicked me!');
})
Even more minimalistic arrow function
// More minimalistic arrow function 
document.addEventListener('click', () => console.log('You clicked me!'))
by Valeri Tandilashvili
4 years ago
JavaScript
Arrow functions
1
Pro tip: use ```triple backticks around text``` to write in code fences