wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Javascript Basics

Total questions: 24

Worksheet time: 13mins

Name
Class
Date
1.
What type of variable is
var numApples = 2; 
a)
Int
b)
Float
c)
Boolean
d)
String
2.
What type of variable is
var typeOfApples="Fuji";
a)
Int
b)
Float
c)
Boolean
d)
String
3.
What type of variable is
var age = "5" 
a)
Int
b)
Float
c)
Boolean
d)
String
4.
What surrounds an if/else statement?
a)
Quotations
b)
Curly Brackets
c)
Parenthesis
d)
Square Brackets
5.
Which one of the following is the symbol for implementing the OR operator?
a)
**
b)
&&
c)
||
d)
!
6.
Which one of the following is the symbol for implementing the AND operator?
a)
&&
b)
**
c)
||
d)
++
7.
What best describes a variable?
a)
they allow the user to change language settings
b)
they allow the user to change the variable's data type
c)
they allow the user to save and call values
d)
they allow the user to declare a new data type
8.
Which of the following will correctly comment the text?
a)
// "the text"
b)
/"the text"/
c)
*/"the text"/*
d)
\\"the text
9.
A string;
a)
Expresses a true false statement
b)
can contain letters, numbers, spaces, and symbols.
c)
takes in an input, does something with it, and then returns an output.
d)
Runs a boolean (true/false) statement based on data entered
10.
The conditional statement, in Javascript, begins with the word _______.
a)
Then
b)
Else
c)
If
d)
OK
11.
Indicates the beginning  and the end of a JavaScript section.
a)
<html> </html>
b)
<style> </style>
c)
<article> </article>
d)
<script> </script>
12.
A user-defined name for a memory location whose value can change over time.
a)
variable
b)
syntax
c)
operator
d)
token
13.
Which of the following formatting tags are HTML and DO NOT need to be inside of the <script> </script> tags?
a)
<div>
b)
<h1>
c)
<h3>
d)
all
14.
In JavaScript, you should include a semi-colon at the end of each statement.
a)
yes
b)
no
15.
JavaScript code is embedded in HTML documents between <script> and </script> tags.
a)
True
b)
False
16.
Programming and scripting languages are translated into this machine-readable form.
a)
Syntax
b)
Binary Code
c)
Compiler
d)
Operator
17.
What type of quotation marks does JavaScript require?
a)
Single quotes (aka apostrophes)
b)
Double quotes
c)
Either single quotes or double quotes
d)
Neither single quotes or double quotes
18.
What character do we use for multiplication?
a)
#
b)
x
c)
*
d)
/
19.
What character do we use for division?
a)
#
b)
x
c)
*
d)
/
20.
How do we count the number of characters in a string?
a)
.length
b)
.numberOfCharacters
c)
.textLength()
d)
String.characters()
21.
How do we declare a variable that can change?
a)
constant
b)
const
c)
letter
d)
let
22.
What punctuation do we use if we need to check 2 conditions in a single if/else statement and either of them needs to be true?
a)
||
b)
*
c)
&
d)
&&
23.
What punctuation do we use if we need to check 2 conditions in a single if/else statement and both of them need to be true?
a)
||
b)
*
c)
&
d)
&&
24.
A JavaScript file has an extension name of
a)
.jscp
b)
.js
c)
.css
d)
.Jp