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.
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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I've always just used the comma operator for this which I can see you do in the very last line
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.
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