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 create getMessage that returns the string "Hello, functions!", with an explicit return type.
πŸ’° Remember to return a string and annotate the return type.

Please set the playground first

Loading "Function Declarations"
Loading "Function Declarations"
Login to get access to the exclusive discord channel.
Loading Discord Posts