Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JS for Me

Total questions: 126

Worksheet time: 1hrs 8mins

Name
Class
Date
1.

Groups of statements that you can execute as a single unit

a)

Functions

b)

Decision-making and flow-control statements

2.

Allow you to determine the order in which statements execute in a program

a)

Functions

b)

Decision-making and flow-control statements

c)

Parameter

3.

_________ are placed within the parentheses that follow a function name

a)

Functions

b)

Decision-making and flow-control statements

c)

Parameter

4.

Make it possible to treat a related group of JavaScript statements as a single unit .

a)

TRUE

b)

FALSE

5.

Like all JavaScript code, functions must be contained within a <script> element or section

a)

TRUE

b)

FALSE

6.

The syntax for defining a function is:

Function name_of_function(parameters) { statements;

}

a)

TRUE

b)

FALSE

7.

To execute a function: –Invoke, or call, it from elsewhere in your program

Function call: _________________________________________

a)

Code that calls a function

b)

The variables or values that you place in the parentheses of the function call statement

c)

Sending arguments to the parameters of a called function

d)

The value of each argument is then assigned to the value of the corresponding parameter in the function definition

8.

To execute a function: –Invoke, or call, it from elsewhere in your program

Arguments: _________________________________________

a)

Code that calls a function

b)

The variables or values that you place in the parentheses of the function call statement

c)

Sending arguments to the parameters of a called function

d)

The value of each argument is then assigned to the value of the corresponding parameter in the function definition

9.

To execute a function: –Invoke, or call, it from elsewhere in your program

Passing arguments: _________________________________________

a)

Code that calls a function

b)

The variables or values that you place in the parentheses of the function call statement

c)

Sending arguments to the parameters of a called function

d)

The value of each argument is then assigned to the value of the corresponding parameter in the function definition

10.

To execute a function: –Invoke, or call, it from elsewhere in your program

When you pass arguments to a function: _________________________________________

a)

Code that calls a function

b)

The variables or values that you place in the parentheses of the function call statement

c)

Sending arguments to the parameters of a called function

d)

The value of each argument is then assigned to the value of the corresponding parameter in the function definition

11.

DECLARED OUTSIDE A FUNCTION

AVAILABLE TO ALL PARTS OF YOUR PROGRAM

a)

GLOBAL VARIABLE

b)

LOCAL VARIABLE

12.

DECLARED INSIDE A FUNCTION

ONLY AVAILABLE WITHIN THE FUNCTION IN WHICH IT IS DECLARED

a)

GLOBAL VARIABLE

b)

LOCAL VARIABLE

13.

Event handler : Code that executes in response to a specific event

a)

TRUE

b)

FALSE

14.

Event handler : Code which is not included as an attribute of the element that initiates the event

a)

TRUE

b)

FALSE

15.

Syntax of an event handler

within an element is:

<element event_handler = “JavaScript code”>

a)

TRUE

b)

FALSE

16.

Event handler names are case-sensitive:

–Must be written using all uppercase letters in order for a document to be well-formed

a)

TRUE

b)

FALSE

17.

Which of the following defines as waiting for an event to trigger?

a)

event

b)

listen

c)

function

d)

value

18.

Which of the terms define as something that can happen on the webpage?

a)

type

b)

value

c)

trigger

d)

event

19.

A term where a block of code that can run later, and can be run many times.

a)

arguments

b)

select

c)

function

d)

value

20.

A term in which an area of code is surrounded by squiggly brackets.

a)

block

b)

function

c)

event

d)

indentation

21.

A code controlled by the block and appears between the squiggly brackets.

a)

onchange

b)

oninput

c)

inside

d)

type

22.

A JavaScript event where you can listen that is triggered whenever an element receives input.

a)

oninput

b)

onchange

c)

onclick

d)

onrange

23.

A term where new element, usually in a drop down, for choosing from different options.

a)

block

b)

value

c)

select

d)

type

24.

An attribute on input and option elements which describes the usefulness of the element.

a)

type

b)

indentation

c)

trigger

d)

value

25.

In coding, it gives an extra way to present what is inside the block.

a)

indentation

b)

parenthesis

c)

curly brackets

d)

option

26.

An attribute on the number and range inputs for configuring them.

a)

curly brackets

b)

max, min, step

c)

parenthesis

d)

indentation

27.

Determine what x would be when assignment operators are used given that  ×=6\times=6   y=12y=12   z=18z=18  
x−=3

x%=4

a)

4 and 5

b)

3 and 2

c)

3 and 7

d)

1 and 2

28.

Perform the operation on operands of different data types given that:

a = 4 , b = happy , c= people, d = 9 , e = memories


Solve : a - d

a)

13

b)

5

c)

8

d)

9

29.

Perform the operation on operands of different data types given that a = 4 , b = happy , c= people, d = 9 , e = memories


Solve: b + c

a)

happy people

b)

people happy

c)

happy memories

d)

happy plus

30.

Determine what result each expression yields if it is True or False. Given that x= 8 and y= 16.


(x!== 9 && y===16 ) || ( x>10 || y!=16)

a)

False

b)

True

31.

Determine what result each expression yields if it is True or False. Given that x= 8 and y= 16.


( x === 8 || y > 5) && ( x! == 7 && y > "11")

a)

True

b)

False

32.

Determine what result each expression yields if it is True or False. Given that x= 8 and y= 16.


( x > "4" || y<=10) || x === 8|| y>15)

a)

True

b)

False

33.

Determine what result each expression yields if it is True or False. Given that x= 8 and y= 16.


( x > 3 && y ! == 7)&&( x>= 6 && y == 16)

a)

True

b)

False

34.

Determine what result each expression yields if it is True or False. Given that x= 8 and y= 16.


!(x=8)

a)

True

b)

False

35.

Determine what result each expression yields if it is True or False. Given that x= 7 and y= 9.


( x >2 && y ! == 9)&&( x>= 6 && y ==9)

a)

True

b)

False

36.

Determine what result each expression yields if it is True or False. Given that x= 5 and y= 3.


( x==2 || y == 3 )||( x<6 && y<9)

a)

True

b)

False

37.

Which of the following is referred to a set of computer instructions or commands that puts together or connects existing components to accomplish a new related task?

a)

script

b)

program

c)

instruction

d)

code

38.

Which of the following is referring to a kind of web scripting optimized to run on the machine that the client is using?

a)

end-user programming

b)

server-side programming

c)

client-side programming

d)

waiter-side programming

39.

Which of the following is an existing subsection of an object?

a)

event

b)

type

c)

parameter

d)

properties

40.

Which of the following company that Brendan Eich developed JavaScript for?

a)

Google LLC

b)

Sun Microsystems

c)

Netscape

d)

Microsoft Corporation

41.

Which of the following is referring to functions that are designed for a specific purpose like doing math or parsing strings?

a)

method

b)

type conversion

c)

reversion

d)

functionality

42.

Which of the following code will returned by the server to your browser after executing the script?

a)

HTML

b)

XHTML

c)

JS

d)

CSS

43.

Which of the following refers to the act of converting a variable from one type to another?

a)

type casting

b)

parsing

c)

type conversion

d)

modification

44.

Which of the following items that usually exist in the browser?

a)

multimedia

b)

elements

c)

webpages

d)

object

45.

Which of the following programming language that treats every element in a system as an object?

a)

Object Oriented Programming Language

b)

Object Directed Programming Language

c)

Oriented Object Programming Language

d)

Object Selection Programming Language

46.

Which of the following is a kind of scripting that is executed on the actual server machine that hosts the webpage?

a)

server-side programming

b)

server-side programming

c)

server-side planning

d)

server programming

47.

Which of the following refers to occurrence in which something happens or is done such as loading a page, holding a mouse over a link, or clicking a link?

a)

event

b)

trigger function

c)

methods

d)

script function

48.

Which of the following is another term for scripting languages that require a browser to run?

a)

Compiled Language

b)

Interpretative Language

c)

Interpreted Language

d)

Preferred Language

49.

Which of the following tool is needed to be able to code JavaScript instructions?

a)

Notepad

b)

Microsoft Office Word

c)

Google Docs

d)

Command Prompt

50.

Which of the following concept in programming that includes integer, string, floating point, or Boolean?

a)

type

b)

method

c)

event

d)

properties

51.

Which of the following tool enables the user to interact with the scripting language?

a)

E-mail

b)

Microsoft Office Powerpoint

c)

Canva

d)

Google Chrome

52.

Which of the following is the file extension of a Javascript file?

a)

.jvscpt

b)

.js

c)

.java

d)

.script

53.

Which of the following object where Javascript object is displayed?

a)

type

b)

event

c)

document

d)

properties

54.

Which of the following object property that sets the color background the user wants?

a)

background-color

b)

background

c)

bkg-clr

d)

bgColor

55.

Which of the following is implemented to make sure JavaScript will not be used to inadvertently harm the innocent user?

a)

antivirus protection

b)

security measures

c)

malware detection

d)

virus detection

56.

Which of the following data or other objects used to describe the characteristics of an object?

a)

function

b)

type

c)

method

d)

parameter

57.

What is JavaScript?

a)

A scripting language

b)

A nucleic acid present in all living cells

c)

A type of rice

d)

A style sheet language used for describing the presentation of a document

58.

These are all uses of JavaScript except for one...

a)

Adds interactive behavior to the webpages.

b)

Develops web server and gaming apps

c)

Creates web and mobile applications

d)

Control how elements are positioned and laid out

59.

What is the tag for External File Script?

a)

<script src="externalfile name.js"> </script>

b)

<script src="file name">

</script>

c)

<script src = "file name.js"> </script>

d)

<script scr="file name.js"> </script>

60.

When was JavaScript invented?

a)

1993

b)

1994

c)

1995

d)

1996

e)

1997

61.

-Used to store data keywords.

-Uses var keyword in declaring ________.

a)

variance

b)

various

c)

variety

d)

variable

62.

Has 'function' or 'block' scope.

a)

Function Scope

b)

Local Scope

c)

Global Scope

d)

Global Scoop

63.

Variables declared inside a block.

a)

Local Scope

b)

Block Scope

c)

Global Scope

d)

Function Scope

64.

Starts with a // and ends with //.

a)

Single Line Comment

b)

Double Line Comment

c)

Multi-Line Comments

d)

Multiple Comments

65.

An __________ (_) is used to assign

values to variables.

a)

Subtraction Sign -

b)

Equal Sign =

c)

Addition Sign +

d)

Parenthesis ()

66.

Used to identify actions to be performed.

a)

CamelCase

b)

Variables

c)

Identifiers

d)

Keywords

67.

It can be an assignment operation, a function call, or a control structure

a)

Comments

b)

Case Sensitivity

c)

Data Types

d)

Statements

68.

These are used to put information that can be useful later, and in JavaScript these are ignored by the browser.

a)

Comments

b)

Case Sensitivity

c)

Data Types

d)

Statements

69.

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

70.

It can be Numeric, String, Boolean or Null.

a)

Comments

b)

Case Sensitivity

c)

Data Types

d)

Statements

71.

A type of network that is limited to a school or a similar location.

a)

LAN

b)

MAN

c)

WAN

d)

CAN

72.

A network limited to a room or building.

a)

LAN

b)

MAN

c)

WAN

d)

CAN

73.

Developed by William Oughtred, the device consists of two movable rulers placed side by side.

a)

Pascal Calculator

b)

Abacus

c)

Slide Rule

d)

Leibnitz Calculator

74.

Who is the first computer programmer?

a)

Bill Gates

b)

Mark Zuckerberg

c)

Lady Ada Agusta

d)

Charles Babbage

75.

Inside which HTML element do we put the JavaScript?

a)

<js>

b)

<script>

c)

<scripting>

d)

<javascript>

76.

The external JavaScript file must contain the <script> tag

a)

true

b)

false

77.

The most widely used internetworking protocol suite.

a)

Protocol

b)

TCP/IP

c)

Client

d)

Server

78.

It describes the geographical location of the company that owns the server. Each country has its own unique alphabetic designation.

a)

Internet

b)

Network

c)

Country Domain

d)

Google Chrome

79.

A computer that manages the resources on a network and the central storage areas for programs and data.

a)

Protocol

b)

Network

c)

Server

d)

Client

80.

An application program that provides a way to look at and interact with all the information on the World Wide Web.

a)

Internet

b)

Network

c)

Browser

d)

Google Chrome

81.

The word internet comes from the term __________.

a)

International Networking

b)

Internal Network

c)

International Network

d)

Internet Networking

82.

A publicly accessible worldwide system of interconnected computer networks that allows users to exchange and retrieve information.

a)

Internet

b)

Network

c)

Net

d)

Networking

83.

It is a set of rules and procedures that governs the exchange of information among computer connected to a network.

a)

Protocol

b)

Server

c)

Client

d)

Network

84.

The name of the server that provides services given by the organization

a)

Country Domain

b)

Top-Level Domain

c)

Domain Name

d)

Server Name

85.

A scheme for connecting two or more distinct computer networks together.

a)

Internet

b)

Network

c)

Net

d)

Internetworking

86.

The developer of the Web and know as the father of internet

a)

Dr. Tam Berners-Lee

b)

Dr. William Fetter

c)

Dr. Ivan Sutherland

d)

Dr. Tim Berners-Lee

87.

The HTML Document Basic Structure or codes that we use to create a web page is basically called

a)

Codes

b)

Elements

c)

HTML File

d)

Attributes

88.

It is the process of inserting formatting instructions to the document.

a)

Marking

b)

HTML

c)

Mark-up

d)

Attributes

89.

These are modifiers that are placed inside theopening tag of an HTML command.

a)

Marking

b)

HTML

c)

Mark-up

d)

Attributes

90.

It contains a palette 216 colors that ensures that all computers will display all the colors correctly.

a)

Web Colors

b)

HTML Color Codes

c)

Web Safe Colors

d)

RGB

91.

It specifies the background color of the document

a)

RGB Color

b)

BG Safe Color

c)

BG Color

d)

BG Background

92.

Country Domain for Malaysia

(a)  

93.

Country Domain for Australia

(a)  

94.

HTML

(a)  

95.

Country Domain for Korea

(a)  

96.

.mil

(a)  

97.

.net

(a)  

98.

Educational Site

(a)  

99.

Commercial Site

(a)  

100.

Network Site

(a)  

101.

HTTP

(a)  

102.
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
103.
What surrounds a string?
a)
Quotations
b)
Curly Brackets
c)
Parenthesis
d)
Square Brackets
104.
To display writing on the screen you must include this direction;
a)
Document Write
b)
documentWrite
c)
document.write( )
d)
document.write
105.
A variable;
a)
Expresses a true false statement
b)
stores a string, number, or boolean, and gives it a specific, case-sensitive name
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
106.
A boolean;
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
107.
A function;
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
108.
An if/else statement;
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
109.
What surrounds an if/else statement?
a)
Quotations
b)
Curly Brackets
c)
Parenthesis
d)
Square Brackets
110.
An array is;
a)
Shapes
b)
Sizes
c)
Options
d)
Lists of data
111.
What surrounds an array?
a)
Quotations
b)
Curly Brackets
c)
Parenthesis
d)
Square Brackets
112.

What type of variable is apple?

var apple = " Fuji "

a)

string

b)

Boolean

c)

array

d)

number

113.

What type of variable is quantites?

var quantities = [2, 4, 10, 1]

a)

string

b)

Boolean

c)

array

d)

number

114.

What is first index value of an array?

a)

2

b)

-1

c)

0

d)

1

115.

What will this code display?

a)

8, 2, 1, 4, 7

b)

82147

c)

Myarray.length

d)

5

116.

What will this code display?

a)

Hello Emma

b)

Hello user

c)

Hello+user

d)

nothing

117.

What will this code display?

a)

570

b)

569

c)

568

d)

attendees

118.

What would this piece of code do?

a)

change the background color of the word demo to red

b)

change the font color of the demo element to red

c)

this is not correct

d)

styles the element with the class demo

119.

Which of these is a method?

a)

getElementById( )

b)

style

c)

document

d)

color

120.

Which line is missing to return the result of the multiplication 10 x 5 ?

a)

result

b)

number 1 * number 2 ;

c)

let result = 10 x 5 ;

d)

var result = number 1 * number 2 ;

121.

Correct this code so that

Hello!

is displayed in the paragraph

with the id "demo"

a)

add

.style.text

after ("demo")

b)

add

.innerHTML

after ("demo")

c)

add a semi colon after myFunction()

d)

Save "Hello" in a variable first

122.

What is the correct syntax to transform a string to upper case?

a)

var txt = "Hello!" ;

toUpperCase( txt );

b)

var txt = "Hello!" ;

toUpperCase.txt();

c)

var txt = "Hello!" ;

txt.toUpperCase();

d)

var txt = "Hello!" ;

txt(toUpperCase);

123.

Which of these methods removes the last element of an array?

a)

pop( )

b)

splice( );

c)

push( )

d)

split( )

124.

What would this piece of code display?

a)

false

b)

x!=8

c)

true

d)

8

125.

What would this piece of code display?

a)

text

b)

John, Joe, Greg, Ruth

c)

John

Joe

Greg

Ruth

d)

4

126.

What would this piece of code display?

a)

10

20

30

40

b)

1

2

3

4

c)

10

20

30

40

50

d)

11

22

33

44