Void type for functions
📖 Scenario: Imagine you are creating a simple logging system for a website. You want to write functions that perform actions but do not return any value.
🎯 Goal: Learn how to write functions in TypeScript that use the void type to indicate they do not return any value.
📋 What You'll Learn
Create a function with
void return typeCall the function to perform an action
Use console.log inside the function to show a message
💡 Why This Matters
🌍 Real World
Functions that perform actions like logging, updating UI, or sending data often do not return values. Using <code>void</code> clearly shows this intent.
💼 Career
Understanding <code>void</code> functions is important for writing clear and correct TypeScript code in web development and software engineering.
Progress0 / 4 steps