wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Script

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the data type used for the following variable var answer1 = "It's alright";

a)

String

b)

Boolean

c)

Integers

2.

"Else IF" is not a condition in JavaScript

a)

True

b)

False

3.

What is the code that could be used to count the number of characters in a value of a variable ?

a)

.count

b)

.length

c)

.total

4.

"Else IF" could be used multiple times.

a)

True

b)

False

5.

What is the code used to allow user input as a value to a variable in JavaScript?

a)

Prompt

b)

Input

c)

==

6.

An "ID" can be a word or a number.

a)

True

b)

False

7.

Choose the codes that allow you to write into a <p> or a <h1>.

a)

document.getElementById

b)

document.write

c)

alert

8.

What is the "++" operator called ?

a)

Incrementing

b)

Decrementing

c)

Two Additions

9.

var x = 4

document.write(x **2)

What would be the value of x?

a)

8

b)

16

c)

15

10.

var x = 5;

var y = 2;

var z = x % y;


What would be the value of "z" in the above code?

a)

1

b)

2

c)

0