wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Script

Total questions: 39

Worksheet time: 23mins

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.

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

a)

True

b)

False

3.

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

a)

document.getElementById

b)

document.write

c)

alert

4.

What is the "++" operator called ?

a)

Incrementing

b)

Decrementing

c)

Two Additions

5.

var x = 4

document.write(x **2)

What would be the value of x?

a)

8

b)

16

c)

15

6.

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

7.

Which of the following is correct about features of JavaScript?

a)

It can not Handling dates and time.

b)

JavaScript is a object-based scripting language.

c)

JavaScript is not interpreter based scripting language.

d)

All of the above

8.

Which of the following is not JavaScript Data Types?

a)

Undefined

b)

Number

c)

Boolean

d)

Float

9.

Choose the correct JavaScript syntax to change the content of the following HTML code.

a)

document.getElement (“WadJava").innerHTML = "I am a WadJava";

b)

document.getElementById (“WadJava").innerHTML = "I am a WadJava";

c)

document.getId (“WadJava") = "I am a WadJava";

d)

document.getElementById (“WadJava").innerHTML = I am a WadJava;

10.

Which symbol is used for comments in Javascript?

a)

\\

b)

//

c)

\* *\

d)

\* */

11.

Javascript string using double quotes is exactly the same as a string using single quotes?

a)

True

b)

False

12.

Find output of below code

var a = '20';

var b = a = 30;

document.write(a+b);

a)

Error in Script

b)

'20'30

c)

2030

d)

50

13.

What is divide by 0 in Javascript? var a = 10;

var b = 0;

document.write(a/b);

a)

Nothing is printed

b)

0 is printed

c)

Infinity is printed

d)

Some Garbage Value

14.
After running the following code, what will be the value of x?
y = 3;
x = 5 * y;
a)
3
b)
5
c)
15
d)
0
15.
Which command colors the background of your canvas?
a)
background 
b)
endShape
c)
var = color
d)
fill
16.
What is at the end of a line of code?
a)
#
b)
;
c)
)
d)
>
17.
How do you turn in your JavaScript assignment?
a)
A link to the Padlet
b)
Click finished in Khan Academy
c)
Add link Spin off link to Google Classroom
d)
Print it out
18.

JavaScript was designed to add _____________________ to HTML pages

a)

pages

b)

files

c)

interactivity

19.

1. JavaScript is the most popular __________________language on the internet

a)

high level

b)

scripting

c)

java

20.

_________________is a small piece of data sent from a website and stored on the user's computer by the user's web browser while the user is browsing

a)

cookies

b)

data website

c)

browser

21.

A JavaScript is usually ___________________directly into HTML pages

a)

connected

b)

embedded

c)

finalised

22.

JavaScript is an ____________________language

a)

compiled

b)

sourced

c)

interpreted

23.

Java Script is ___________ sensitive language

a)

case

b)

insensitive

c)

useless

24.
Scripts can be placed in the________, or in the _____ section of an HTML page, or in both.
a)
 <body>, <head>
b)
<html>, <head>
c)
<body> <script>
d)
<html>, <script>
25.
To insert a JavaScript into an HTML page, use the _________ tag.
a)
<java>
b)
<jvcrb>
c)
<script>
d)
<jscript>
26.
JavaScript files have the file extension ______.
a)
.jsc
b)
.scj
c)
.js
d)
.html
27.
To use an external script, put the name of the script file in the ______ (source) attribute of the <script> tag:
a)
html
b)
img
c)
tag
d)
src
28.
In a programming language, __________ are used to store data values.
a)
tags
b)
codes
c)
files
d)
variables
29.
JavaScript uses the _______ keyword to define variables.
a)
vrb
b)
var
c)
vari
d)
va
30.
To view a web page in a browser, you must know the ____.
a)
keyword
b)
password
c)
URL
d)
ip
31.
A ________ is composed of many files that are located on a _________.
a)
application , computer
b)
software , local discs
c)
page, storage device
d)
website , web server
32.
URL stands for ________________.
a)
Uniform Resource Locator
b)
Up Restriction Leader
c)
Uniform Risks Locator 
d)
United Resource Locator
33.
The URL is also called a web page _______ or a website _________ .
a)
address , address
b)
address , view
c)
address , entrance
d)
direction , address
34.
The  _________ name uniquely identifies a website.
a)
support 
b)
adress
c)
sofware
d)
domain
35.
A domain name points to the ___________ of the web server.
a)
storage
b)
IP address 
c)
website
d)
local file
36.
The  ___________ is a web page that has been marked as the default page to display by the web server.
a)
subpage
b)
first page
c)
home page
d)
website
37.
IP address stands for __________. 
a)
Interview Protocol address
b)
Internet Protocol address
c)
Interchange Protocol address
d)
Internal Protocol address
38.
The image file type must be _________ .
a)
.gif, .jpg, or .png
b)
.gif
c)
 .jpg
d)
.png
39.
WYSIWYG stands for _________________________________ .
a)
Way you see is what you go
b)
What you see is what you get