wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Codecademy JavaScript

Total questions: 21

Worksheet time: 14mins

Name
Class
Date
1.

His name is Fred and he is less than 16 years old

a)

if (name = "fred" && age < 16 )

b)

if (name === "fred" && age < 16 )

c)

if (name = "fred" || age < 16 )

d)

if (name === "fred" || age < 16 )

2.

Repeat something 10 times

a)

repeat 10

b)

for (var i=0; i<10; i++)

c)

repeat { } until 10;

d)

while (i = 10)

3.

What is the symbol used for the INCREMENT operator in JS?

a)

+

b)

++

c)

=

d)

==

4.

Conditions return values of which data type?

a)

Integer

b)

boolean

c)

floating-point

d)

string

5.

Loops in programming start counting from ?

a)

0

b)

1

c)

Any number

6.

What symbol represents the or operator in JavaScript?

a)

OR

b)

or

c)

||

d)

|

7.
Arithmetic Operators
What is ++ ?
a)
Modulo
b)
increment
c)
Decrement
d)
Addition
8.
Which one of the following is NOT a logical operator?
a)
||
b)
&&
c)
$$
d)
!
9.
Generally speaking, what functionality does JavaScript provide when used as part of the "Web development trifecta"?
a)
Page manipulation capabilities and advanced interactivity
b)
Content and page structure, but minimum interactivity
c)
Formatting and page design, plus some simple interactivity
d)
Content, page structure, and advanced interactivity
10.
JavaScript is a scripting language. Scripting languages:
a)
interpret and automate a list of tasks that would otherwise be executed one-at-a-time by a person.
b)
interpret and execute a list of tasks once the list is compiled.
c)
need the server to interpret a script and to return the appropriate responses.
d)
perform their functionality on the server side, which reduces processing time dramatically.
11.

Which of these is a loop?

a)

if(x<10)

b)

while(x<10)

c)

var x=10;

d)

text(x,10;10)

12.

Which command provides a random color?

a)

Randomizer.color

b)

Randomizer.nextColor()

c)

RandColor;

d)

nextColor.Randomizer()

13.

Which of these will increase the value of the variable X?

a)

increment (x)

b)

x++;

c)

x=x;

d)

x+1;

14.

Names that refer to commands, functions, variables and keyword should be written correctly, variable “A” and “a” are two different variables.

a)

Comments

b)

Case Sensitivity

c)

Data Types

d)

Statements

15.

Conditions return values of which data type?

a)

Integer

b)

boolean

c)

floating-point

d)

string

16.
A condition is __________.
a)
any expression that evaluates to True or False
b)
a built-in function that assigns a Boolean value to a variable
c)
a formula that is executed for a result
d)
an operand that indicates both conditions are True or False
17.
In JavaScript, which of the follow operand symbols means not equal to?
a)
<> 
b)
= # =
c)
!=
d)
##
18.
When drawing in Javascript, the coordinates for the top left of the screen is:
a)
0,400
b)
0,0
c)
400,0
d)
400,400
19.

Where do the <script></script> tags go in your document

a)

Within <img> tags

b)

In the <p></p> tags

c)

In the <title>

d)

In the <head> or <body>

20.

Statement lets you ask a question to the program and only run code if the answer is true.

a)

If Else Statement

b)

Condition

c)

If Statement

d)

Parentheses

21.

Control structure that lets us do either one section of code or another depending on a test.

a)

If Else Statement

b)

Condition

c)

If Statement

d)

Parentheses