Lesson ยท 5 min
Say hello
Your first program
A program is a list of instructions that a computer follows, one line at a time. In JavaScript, one of the most useful instructions is console.log. It writes a message to the console, the panel below the editor.
console.log('Good morning!');
The message in quotation marks is called a string. A string is a piece of text. You can use single quotes 'like this' or double quotes "like this".
Two details matter:
console.logstarts with a lower-casec. JavaScript treatsConsoleandconsoleas different names.- The line ends with a semicolon
;. The semicolon marks the end of an instruction.
Your turn
Write your code in the editor, then press Run to see the output. When you think you are done, press Check my work.
Tasks
2 to do
Task 1, not checked yet. Print the text
Hello, world!withconsole.log.Task 2, not checked yet. On the next line, print
I am learning JavaScript.
Task 1 of 2
Print the text Hello, world! with console.log.