WorksheetsJavascript Basics Test
Total questions: 20
Worksheet time: 9mins
Name
Class
Date
1.
Which of the following is the correct Javascript format for a comment?
a)
// "the text"
b)
/"the text"/
c)
*/"the text"/*
d)
\\"the text
2.
The conditional statement, in Javascript, begins with the word _______.
a)
Then
b)
Else
c)
If
d)
OK
3.
Indicates the beginning and the end of a JavaScript section.
a)
<html> </html>
b)
<style> </style>
c)
<article> </article>
d)
<script> </script>
4.
A user-defined name for a memory location whose value can change over time.
a)
variable
b)
syntax
c)
operator
d)
token
5.
In JavaScript, you should include a semi-colon at the end of each statement.
a)
yes
b)
no
6.
JavaScript code is embedded in HTML documents between <script> and </script> tags.
a)
True
b)
False
7.
What character do we use for multiplication?
a)
#
b)
x
c)
*
d)
/
8.
What character do we use for division?
a)
#
b)
x
c)
*
d)
/
9.
A JavaScript file has an extension name of
a)
.jscp
b)
.js
c)
.css
d)
.Jp
10.
Where does JavaScript code go in an HTML document?
a)
<script> tag
b)
<html> tag
c)
<style> tag
d)
<button> tag
11.
What's the data type?
a)
String
b)
Number
12.
Which keyword do we need to define a function?
a)
function
b)
method
c)
onclick
d)
functionName()
13.
How do you make a button in HTML?
a)
<button>Text</button>
b)
<button text="Text"></button>
c)
<button>Text<button>
d)
<button Text>
14.
Which of the following best describes what a function is used for?
a)
they create new variable commands
b)
they are used for difficult math formulas
c)
they are reusable pieces of code that can be called any time in the program
d)
they allow for the use of mathematical operators
15.
What best describes the function of a for loop?
a)
it loops through a block of code for a finite amount of times
b)
it looks for a loop in a block of code
c)
it loops through code only within a function
d)
it loops through a block of code forever
16.
What will happen if an infinite while loop is ran?
a)
the program will crash
b)
the computer will crash
c)
the loop will just keep running
d)
an error message will be displayed
17.
Color is defined by these three colors
a)
Red, purple, orange
b)
Red, Blue, Green
c)
Green, Blue, Orange
18.
Which 1 of the following symbols is used for JavaScript comments?
a)
\\
b)
^
c)
?
d)
//
19.
What surrounds a string?
a)
Quotations
b)
Curly Brackets
c)
Parenthesis
d)
Square Brackets
20.
Bonus Question: What is the web programming Trifecta?
a)
HTML, CSS, Javascript
b)
Java, C+, HTML
c)
Java, HTML, CSS
d)
Kobe, Labron, Jordan
100 %
