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
-
Earu5703yOnly reason I’ve ever used it was for TS but as far as I know that’s a different concept from the JS void operator
-
Technically you can capture the value of a method with no return and you'll have a void.
Compares truish to null and true to undefined. -
john-doe9403yWhen I was younger and wiser I used to return void 0, instead of not returning anything. 🤣
It was mainly to annoy other people. -
@eo2875 Mostly in TS context, but there are some uses for it in plain JS too.
Extremely rare though, but you said "EVER" and the answer is yes. :)
Edit: https://developer.mozilla.org/en-US...
Related Rants
Have you EVER used `void` in JavaScript?!
question
javascript
void
js