What are the differences between the two code snippets below, including any advantages or disadvantages of one over the other?
const a = (b) => (
b = b * 10,
console.log(b),
true && console.log('true'),
false && console.log('false'),
b = b * 2
)
const a = (b) => {
b = b * 10;
console.log(b);
if(true) console.log('true');
if(false) console.log('false');
b = b * 2;
return b;
}
I recently saw a project in which the dev used parentheses in virtually every situation and wanted to understand that better.