Debugging Simple Arrow Functions More Efficiently

Debugging Simple Arrow Functions More Efficiently

Let’s say we have the function below.

I prefer use comma operator

const complexFunction = (a, b) =>  (console.log("[DEBUG]", a, b), a + b);
// or 
const complexFunction = (a, b) =>  (console.log("[DEBUG] a →", a), console.log("[DEBUG] b →", b), a + b);

@davidnussio
Thanks for sharing, did not know about this! :raised_hands: