Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I think that it's confusing, and arrow functions can usually do a better and more clear job.
-
antxony215yAs the other guy said it is confusing, but like 99% of JS is confusing so idk, it may be useful for some people but I think there are better and more readable ways to manage those comma cases -
I literally only use the comma operator in for loops when declaring multiple variables. Feel like it’s confusing to look at in any other context.
-
Splitting a one-liner to multiple lines with comments in between should be illegal. Is it common in webdev?
-
@electrineer i read up on it. As soon as you see the need to do it just don't do it.
-
Wtf why does my last comment contain a user tag.. sorry, that wasn't intended, must've been late.
Related Rants

What only relying on JavaScript for HTML form input validation looks like
Found something true as 1 == 1
What do you guys think about the comma expression in JavaScript? I'm aware that due to it's (to some) unknown nature that it can lead to subtle bugs, but I have at least one good use case for it and wanted to hear reasons why I shouldn't use it for similar use cases, but also what would be some other cool (not necessarily "good") use cases :D
question
javascript
js
comma expression