Skip to main content
🌱 Coding Level 1: First Steps 🌱

Read the Code πŸ‘€

Coders read a lot of code. Let's practice reading a tiny bit before we write any.

Here is a little machine called a function. You give it a name and, when you call it, it hands something back with the word return:

function greet() {
  return "Hi there!";
}

When we call greet(), it hands back the words "Hi there!".

The words in "quotes" are called a string β€” that's just coder-speak for text. 🧡

Read the code above, then answer below. πŸ‘‡

When we call greet(), what does it hand back?

Here is another function:

function pet() {
  return "cat";
}

What does pet() hand back?

The word return means: