Function Declarations

Function Declaration
πŸ‘¨β€πŸ’Ό We need a tiny helper that returns a message to show in the UI. Let's start with the simplest possible function.
A function declaration looks like this:
function getFavoriteNumber(): number {
	return 28
}
🐨 Open
index.ts
and:
  1. Create a function declaration named getMessage
  2. Give it an explicit return type of string
  3. Return exactly "Hello, functions!"
  4. Export getMessage

Required exports

  • getMessage

Completion criteria

  • getMessage() returns "Hello, functions!"
πŸ’° Remember to return a string and annotate the return type.

Please set the playground first

Loading "Function Declarations"
Loading "Function Declarations"