The void operator is an operator that returns "undefined" no matter what value you enter.
So whether it's void (0), void (123) or void ("ABC"), all the results will be returned as "undefined".
By convention, void (0) is now used.
And when to use it, use it when you want to disable the operation.
Generally, it has been used when you want to invalidate the screen transition of a tag link.
These days, this style of writing is not highly recommended.
Also, please note that it may not be available on older browsers.