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
-
How would a loop solve this? How would a reducer solve this?
Aside from the +=, this is perfectly reasonable and understandable code, and I would imagine it's much more performant than using any fancy control logic. -
Assuming all the other ratings will always be available, as soon as the first one is present... 😂
-
How about... Just this crazy idea...
We use... Objects.
I know... Crazy.
And now. Deep breath! Darum dum dum....
Fuuuunnnctttiooons.
Yeah. Dope shit. Right?
And if we put the object in the function, do not modify it, and return the correct value...
Whoooaaa....
No iffies. No elsies. Nothing like that.
We could even do fancier stuff, but right now. Start there.
*shakes head* -
C0D4669024yIs no one else getting that urge to fix the spacing at the comma ,it's really grinding my gears right now.
-
Nah, loops are too complicated. Nobody can comprehend what they are doing.
Reducers? No, no, no. That is devilish witchcraft.
"Loops? Reducers? No, we've never have heard of that."
rant