Skip to main content
🌱 Programming for Complete Beginners

Read Before You Write πŸ‘€

Welcome! πŸ‘‹ You're about to learn to code. Take a breath β€” we'll go one tiny step at a time, and you genuinely can't break anything. 🌱

Before you write any code, let's read a little. Coders read way more than they write, so this is the perfect first skill.

Here's the big idea: a program can take a value β€” a number, or some text β€” and hand a value back to you. The word that hands something back is return.

Look at this tiny example. It always hands back the number 7:

function lucky() {
  return 7;
}

When we "run" it by writing lucky(), it hands back 7. That's it!

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

Read the examples in each question, then pick what gets handed back. You've got this. πŸ‘‡

Look at this:

function lucky() {
  return 7;
}

When we run lucky(), what does it hand back?

Here is another one:

function pet() {
  return "cat";
}

What does pet() hand back?

The word return means: