← #4 Do not add custom methods to primitive objects
#5

Wrap arrow function body in parentheses

Topics: JavaScript

If the inline arrow function consists of the <, <=, > or >= operator, it is advised to wrap the function body in parentheses.

Looking at the two versions below, it is easy for the first variant to cause a misleading.

// Bad
const compareToZero = a => a <= 0 ? 0 : a;

// Good
const compareToZero = a => (a <= 0 ? 0 : a);
Fix a typo or suggest an improvement
#6 Indicate img elements that miss alt attribute