DEV Community

Discussion on: Why (We) Make Room For `console.log`?

Collapse
 
jacobmparis profile image
Jacob Paris

I've always just used the comma operator for this which I can see you do in the very last line

Collapse
 
easilybaffled profile image
Danny Michaelis

I'm glad to see someone else has used the comma operator. I had started the same way, but over time, it was simpler for me to pull the functionality into its own function.
Also, it has been my experience that most people aren't familiar with the comma operator, which isn't helped by ESLint's no-sequences rules.

Collapse
 
samuelneff profile image
Samuel Neff

Most of the places I've been the comma operator is disallowed due to linting rules or SonarQube. I would use it more if not for that. eslint.org/docs/rules/no-sequences