Programming Basics: Your First Steps

Lesson 1 of 5

Hello, Programming!

Welcome! This is your first step into programming, no experience required. We'll use JavaScript, the language that runs in every web browser, so you can try it right here without installing anything.

JavaScript

Reading it line by line

  • let name = "friend"; creates a variable, a named box that holds a value, here the text "friend".
  • console.log(...) prints whatever is inside the parentheses, the most common way to see what your code is doing.
  • "Hello, " + name + "!" concatenates (joins) three pieces of text into one: "Hello, ", the value stored in name, and "!".

Try it yourself

Change "friend" to your own name in the code block above, then click Run and watch the output update.

Why variables matter

Without a variable, you'd have to retype "friend" everywhere you wanted to use it. With one, you can change the value in a single place and everything that uses it updates. This idea, storing and reusing values, is the foundation everything else in programming builds on.

📝 Hello, Programming! Quiz

Passing score: 70%
  1. 1.What does console.log(...) do?

  2. 2.let name = "friend"; creates a ____ that holds the value "friend".

  3. 3.Text after // on a line is a comment and is ignored by the computer.