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
-
You forgot
??=
||=
&&=
I'm in love with them btw, so much code that can be reduce with a ?. ( + often ?? )
Waiting for hack pipes ..
( https://proposals.es/proposals/... ) -
@ElectroArchiver oh, once I learned about the pipe operator, I fell in love with it, too!
And then I’ve implemented it in C# and Swift. :D -
@electrineer
No idea if you're meming or actually don't know,
but for the people that aren't familiar with the operators:
a ?? b returns b if a is null or undefined
a?.b only returns / calls / continues the chain if a exists
a ? b : c standard ternary operator
a ??= b if a is null or undefined set it to b
a ||= b if a is false, set it to b
a &&= if a is true, set it to b
so
?. <- optional chaining
?? <- nullish coalescing
? <- conditional/ternary operator
dunno why, I can't seem to remember optional chaining off the top of my head.
random
javascript