Void Functions

Void Functions
πŸ‘¨β€πŸ’Ό Many functions in real applications don't return valuesβ€”they perform actions. These are called side effects, and they return void.
Examples of side effects:
  • Logging information
  • Updating the UI
  • Sending data to a server
  • Playing a sound
🐨 Open
index.ts
and:
  1. Create a logInfo function that logs a message with "[INFO]" prefix
  2. Create a logError function that logs with "[ERROR]" prefix
  3. Create a logWithTimestamp function that includes the current time
πŸ’° Use Date to get the current time and include it in the log.
πŸ’° Void functions don’t return a value.

Please set the playground first

Loading "Void Functions"
Loading "Void Functions"
Login to get access to the exclusive discord channel.
Loading Discord Posts