Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 948 Bytes

File metadata and controls

30 lines (20 loc) · 948 Bytes

JavaScript - Use arrow functions

in all cases when you don't need context of this particular function.

npm - eslint-plugin-prefer-arrow-functions
Google - JS Styleguide - Features functions arrow functions When should I use Arrow functions in ECMAScript 6?

❌ BAD
function sum({a, b}) {
    return a + b;
}
✔ GOOD
const sum = ({a, b}) => (a + b); // "sum" is named arrow function which has name in stacktrace

Back to Code Guide - JavaScript

Back to Code Guide - Readme


Copyright © 2017 Stanislav Kochenkov