typescript · level 1 · unit 1 · lesson 2
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
shows a message on the screen.
The console is the part of the screen where your program's messages appear. console.log writes a message there. Whatever you put inside its brackets is what appears.
Words go inside quote marks, like "Hello, world!". A piece of text in quotes is called a . Picture the letters threaded on a string, like beads. The quotes are not shown.
The ; at the end works like a full stop. It tells TypeScript that this instruction is finished.
console.log("Hello, world!"); Use the same quote mark at both ends of your string.
guess first
What will appear on the screen?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
console.log("My cat is called Pickles");
your turn
Your turn. Tell the computer what you love to eat.
Type your favourite food in place of the blank, keeping it inside the quotes. Then press run.
fix it
This line will not run. Can you fix it?
- Look at what comes straight after
console.log. console.logneeds round brackets to hold the string it shows. Are there any?- Put ( after console.log and ) before the semicolon, then press run.
nailed it
you made the computer talk. :D
console.logshows whatever is inside its brackets.- Text inside quote marks is called a string.
- A semicolon ends each instruction, like a full stop.
new words in your collection
- console
- string
- semicolon
This lesson isn’t saved. A free account remembers every lesson you finish.