0
0
Javascriptprogramming~5 mins

Writing first JavaScript program - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the simplest way to display a message in JavaScript?
Use console.log('Your message'); to print a message to the browser's console.
Click to reveal answer
beginner
What does console.log('Hello, world!'); do?
It prints the text Hello, world! to the browser's console, which is a place to see messages from your program.
Click to reveal answer
beginner
Where do you write JavaScript code to run it in a web browser?
You can write JavaScript inside a <script> tag in an HTML file or in a separate .js file linked to the HTML.
Click to reveal answer
beginner
How do you run your first JavaScript program in a browser?
Open your HTML file with the JavaScript code in a web browser, then open the browser's developer console to see the output.
Click to reveal answer
beginner
Why is console.log() useful when learning JavaScript?
It helps you see what your program is doing by showing messages, making it easier to understand and find mistakes.
Click to reveal answer
Which JavaScript command prints text to the console?
Aecho()
Bprint()
Cconsole.log()
Dwrite()
Where do you put JavaScript code inside an HTML file?
A<head> tag only
B<script> tag
C<body> tag only
D<style> tag
What do you need to open to see the output of console.log()?
ABrowser console
BHTML page
CText editor
DCommand prompt
Which file extension is used for JavaScript files?
A.js
B.java
C.html
D.css
What is the purpose of writing your first JavaScript program?
ATo create a website layout
BTo write text documents
CTo design images
DTo learn how to make the computer do things
Explain how to write and run your first JavaScript program in a web browser.
Think about where the code goes and how you see the result.
You got /4 concepts.
    Why is using console.log() helpful when starting to learn JavaScript?
    Consider how you check what your program does.
    You got /4 concepts.