wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JavaScript

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Which of the following are valid keywords for JavaScript?

a)

let

b)

var

c)

const

d)

def

2.

A callback is a function that is passed as an argument to another function.

a)

True

b)

False

3.

Which symbol is used as an abbreviation for the jQuery function?

a)

%

b)

&

c)

$

d)

@

4.

JavaScript is a simpler form of Java built for the web.

a)

True

b)

False

5.

The Document Object Model (DOM) can be used to:

a)

Find elements by class

b)

Create new elements

c)

Retrieve data from a server

d)

Change element styles

6.

The code in a function can access variables declared outside of the function.

a)

True

b)

False

7.

Variables declared inside of a function are accessible outside of the function?

a)

True

b)

False

8.

The syntax for JavaScript objects is similar to the syntax for Python dictionaries?

a)

True

b)

False

9.

What is the name of the JavaScript standard?

a)

JavaScript

b)

ECMA Script

c)

JS

d)

PEP

10.

The ++ operator increments the value of the operand by one.

a)

True

b)

False

11.

Which operator can be used with both strings and numbers?

a)

-

b)

+

c)

/

d)

*

12.

What will be logged to the console here?
console.log(5 + 7 + "hello" +5 + 12);

a)

57hello512

b)

12hello17

c)

12hello512

d)

57hello17

13.

In the following code snippet, what is the value of "thing"?
var thing;

a)

null

b)

"thing"

c)

undefined

d)

""

14.

What native JavaScript API would you use to get data from a remote server?

a)

fetch

b)

ajax

c)

get

d)

URL

15.

Which of the following document methods can be used to select an element by its classes?

a)

getElementById()

b)

querySelector()

c)

getElementsByClassName()

d)

getElementsByTagName()