Sumit kumar Singh
1 min readApr 20, 2023

--

Hello,

Thank you so much for taking the time to read my article and leaving such a kind comment!

While it is true that both NEVER and VOID do not return a value, there is a fundamental difference between them.

NEVER is a type that represents a value that can never occur, meaning that it is used to denote code that should never execute or a situation that should never happen. It is often used in type systems to indicate that a certain function or expression will never return a value. For example, if a function always throws an exception, its return type can be declared as NEVER.

On the other hand, VOID is a keyword in some programming languages that indicates that a method or function does not return a value. It is used to specify that the method is intended to perform some operation or side effect, but not to produce a result.

So, while both NEVER and VOID do not return a value, they serve different purposes in the context of programming.

If you enjoy reading my articles, please consider subscribing to my Medium channel to stay updated on my latest content.

--

--

Sumit kumar Singh
Sumit kumar Singh

Written by Sumit kumar Singh

YouTube: https://shorturl.at/8zZ4B Topmate: https://topmate.io/sumit_kr_singh 📚 HTML, Angular, React, and JavaScript 🧑‍💻 Tips & tricks

No responses yet