Using the comma operator helps you to chain multiple conditions. It's not just about the if statement, you can use it in the variable definition or function calls.
I highly recommend to read this.