WorksheetsJS for Me
Total questions: 126
Worksheet time: 1hrs 8mins
Groups of statements that you can execute as a single unit
Functions
Decision-making and flow-control statements
Allow you to determine the order in which statements execute in a program
Functions
Decision-making and flow-control statements
Parameter
_________ are placed within the parentheses that follow a function name
Functions
Decision-making and flow-control statements
Parameter
Make it possible to treat a related group of JavaScript statements as a single unit .
TRUE
FALSE
Like all JavaScript code, functions must be contained within a <script> element or section
TRUE
FALSE
The syntax for defining a function is:
Function name_of_function(parameters) { statements;
}
TRUE
FALSE
To execute a function: –Invoke, or call, it from elsewhere in your program
Function call: _________________________________________
Code that calls a function
The variables or values that you place in the parentheses of the function call statement
Sending arguments to the parameters of a called function
The value of each argument is then assigned to the value of the corresponding parameter in the function definition
To execute a function: –Invoke, or call, it from elsewhere in your program
Arguments: _________________________________________
Code that calls a function
The variables or values that you place in the parentheses of the function call statement
Sending arguments to the parameters of a called function
The value of each argument is then assigned to the value of the corresponding parameter in the function definition
To execute a function: –Invoke, or call, it from elsewhere in your program
Passing arguments: _________________________________________
Code that calls a function
The variables or values that you place in the parentheses of the function call statement
Sending arguments to the parameters of a called function
The value of each argument is then assigned to the value of the corresponding parameter in the function definition
To execute a function: –Invoke, or call, it from elsewhere in your program
When you pass arguments to a function: _________________________________________
Code that calls a function
The variables or values that you place in the parentheses of the function call statement
Sending arguments to the parameters of a called function
The value of each argument is then assigned to the value of the corresponding parameter in the function definition
DECLARED OUTSIDE A FUNCTION
AVAILABLE TO ALL PARTS OF YOUR PROGRAM
GLOBAL VARIABLE
LOCAL VARIABLE
DECLARED INSIDE A FUNCTION
ONLY AVAILABLE WITHIN THE FUNCTION IN WHICH IT IS DECLARED
GLOBAL VARIABLE
LOCAL VARIABLE
Event handler : Code that executes in response to a specific event
TRUE
FALSE
Event handler : Code which is not included as an attribute of the element that initiates the event
TRUE
FALSE
Syntax of an event handler
within an element is:
<element event_handler = “JavaScript code”>
TRUE
FALSE
Event handler names are case-sensitive:
–Must be written using all uppercase letters in order for a document to be well-formed
TRUE
FALSE
Which of the following defines as waiting for an event to trigger?
event
listen
function
value
Which of the terms define as something that can happen on the webpage?
type
value
trigger
event
A term where a block of code that can run later, and can be run many times.
arguments
select
function
value
A term in which an area of code is surrounded by squiggly brackets.
block
function
event
indentation
A code controlled by the block and appears between the squiggly brackets.
onchange
oninput
inside
type
A JavaScript event where you can listen that is triggered whenever an element receives input.
oninput
onchange
onclick
onrange
A term where new element, usually in a drop down, for choosing from different options.
block
value
select
type
An attribute on input and option elements which describes the usefulness of the element.
type
indentation
trigger
value
In coding, it gives an extra way to present what is inside the block.
indentation
parenthesis
curly brackets
option
An attribute on the number and range inputs for configuring them.
curly brackets
max, min, step
parenthesis
indentation
Determine what x would be when assignment operators are used given that ×=6 y=12 z=18
x−=3
x%=4
4 and 5
3 and 2
3 and 7
1 and 2
Perform the operation on operands of different data types given that:
a = 4 , b = happy , c= people, d = 9 , e = memories
Solve : a - d
13
5
8
9
Perform the operation on operands of different data types given that a = 4 , b = happy , c= people, d = 9 , e = memories
Solve: b + c
happy people
people happy
happy memories
happy plus
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)
False
True
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")
True
False
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)
True
False
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)
True
False
Determine what result each expression yields if it is True or False. Given that x= 8 and y= 16.
!(x=8)
True
False
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)
True
False
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)
True
False
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?
script
program
instruction
code
Which of the following is referring to a kind of web scripting optimized to run on the machine that the client is using?
end-user programming
server-side programming
client-side programming
waiter-side programming
Which of the following is an existing subsection of an object?
event
type
parameter
properties
Which of the following company that Brendan Eich developed JavaScript for?
Google LLC
Sun Microsystems
Netscape
Microsoft Corporation
Which of the following is referring to functions that are designed for a specific purpose like doing math or parsing strings?
method
type conversion
reversion
functionality
Which of the following code will returned by the server to your browser after executing the script?
HTML
XHTML
JS
CSS
Which of the following refers to the act of converting a variable from one type to another?
type casting
parsing
type conversion
modification
Which of the following items that usually exist in the browser?
multimedia
elements
webpages
object
Which of the following programming language that treats every element in a system as an object?
Object Oriented Programming Language
Object Directed Programming Language
Oriented Object Programming Language
Object Selection Programming Language
Which of the following is a kind of scripting that is executed on the actual server machine that hosts the webpage?
server-side programming
server-side programming
server-side planning
server programming
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?
event
trigger function
methods
script function
Which of the following is another term for scripting languages that require a browser to run?
Compiled Language
Interpretative Language
Interpreted Language
Preferred Language
Which of the following tool is needed to be able to code JavaScript instructions?
Notepad
Microsoft Office Word
Google Docs
Command Prompt
Which of the following concept in programming that includes integer, string, floating point, or Boolean?
type
method
event
properties
Which of the following tool enables the user to interact with the scripting language?
Microsoft Office Powerpoint
Canva
Google Chrome
Which of the following is the file extension of a Javascript file?
.jvscpt
.js
.java
.script
Which of the following object where Javascript object is displayed?
type
event
document
properties
Which of the following object property that sets the color background the user wants?
background-color
background
bkg-clr
bgColor
Which of the following is implemented to make sure JavaScript will not be used to inadvertently harm the innocent user?
antivirus protection
security measures
malware detection
virus detection
Which of the following data or other objects used to describe the characteristics of an object?
function
type
method
parameter
What is JavaScript?
A scripting language
A nucleic acid present in all living cells
A type of rice
A style sheet language used for describing the presentation of a document
These are all uses of JavaScript except for one...
Adds interactive behavior to the webpages.
Develops web server and gaming apps
Creates web and mobile applications
Control how elements are positioned and laid out
What is the tag for External File Script?
<script src="externalfile name.js"> </script>
<script src="file name">
</script>
<script src = "file name.js"> </script>
<script scr="file name.js"> </script>
When was JavaScript invented?
1993
1994
1995
1996
1997
-Used to store data keywords.
-Uses var keyword in declaring ________.
variance
various
variety
variable
Has 'function' or 'block' scope.
Function Scope
Local Scope
Global Scope
Global Scoop
Variables declared inside a block.
Local Scope
Block Scope
Global Scope
Function Scope
Starts with a // and ends with //.
Single Line Comment
Double Line Comment
Multi-Line Comments
Multiple Comments
An __________ (_) is used to assign
values to variables.
Subtraction Sign -
Equal Sign =
Addition Sign +
Parenthesis ()
Used to identify actions to be performed.
CamelCase
Variables
Identifiers
Keywords
It can be an assignment operation, a function call, or a control structure
Comments
Case Sensitivity
Data Types
Statements
These are used to put information that can be useful later, and in JavaScript these are ignored by the browser.
Comments
Case Sensitivity
Data Types
Statements
Names that refer to commands, functions, variables and keyword should be written correctly, variable “A” and “a” are two different variables.
Comments
Case Sensitivity
Data Types
Statements
It can be Numeric, String, Boolean or Null.
Comments
Case Sensitivity
Data Types
Statements
A type of network that is limited to a school or a similar location.
LAN
MAN
WAN
CAN
A network limited to a room or building.
LAN
MAN
WAN
CAN
Developed by William Oughtred, the device consists of two movable rulers placed side by side.
Pascal Calculator
Abacus
Slide Rule
Leibnitz Calculator
Who is the first computer programmer?
Bill Gates
Mark Zuckerberg
Lady Ada Agusta
Charles Babbage
Inside which HTML element do we put the JavaScript?
<js>
<script>
<scripting>
<javascript>
The external JavaScript file must contain the <script> tag
true
false
The most widely used internetworking protocol suite.
Protocol
TCP/IP
Client
Server
It describes the geographical location of the company that owns the server. Each country has its own unique alphabetic designation.
Internet
Network
Country Domain
Google Chrome
A computer that manages the resources on a network and the central storage areas for programs and data.
Protocol
Network
Server
Client
An application program that provides a way to look at and interact with all the information on the World Wide Web.
Internet
Network
Browser
Google Chrome
The word internet comes from the term __________.
International Networking
Internal Network
International Network
Internet Networking
A publicly accessible worldwide system of interconnected computer networks that allows users to exchange and retrieve information.
Internet
Network
Net
Networking
It is a set of rules and procedures that governs the exchange of information among computer connected to a network.
Protocol
Server
Client
Network
The name of the server that provides services given by the organization
Country Domain
Top-Level Domain
Domain Name
Server Name
A scheme for connecting two or more distinct computer networks together.
Internet
Network
Net
Internetworking
The developer of the Web and know as the father of internet
Dr. Tam Berners-Lee
Dr. William Fetter
Dr. Ivan Sutherland
Dr. Tim Berners-Lee
The HTML Document Basic Structure or codes that we use to create a web page is basically called
Codes
Elements
HTML File
Attributes
It is the process of inserting formatting instructions to the document.
Marking
HTML
Mark-up
Attributes
These are modifiers that are placed inside theopening tag of an HTML command.
Marking
HTML
Mark-up
Attributes
It contains a palette 216 colors that ensures that all computers will display all the colors correctly.
Web Colors
HTML Color Codes
Web Safe Colors
RGB
It specifies the background color of the document
RGB Color
BG Safe Color
BG Color
BG Background
Country Domain for Malaysia
(a)
Country Domain for Australia
(a)
HTML
(a)
Country Domain for Korea
(a)
.mil
(a)
.net
(a)
Educational Site
(a)
Commercial Site
(a)
Network Site
(a)
HTTP
(a)
What type of variable is apple?
var apple = " Fuji "
string
Boolean
array
number
What type of variable is quantites?
var quantities = [2, 4, 10, 1]
string
Boolean
array
number
What is first index value of an array?
2
-1
0
1
What will this code display?
8, 2, 1, 4, 7
82147
Myarray.length
5
What will this code display?
Hello Emma
Hello user
Hello+user
nothing
What will this code display?
570
569
568
attendees
What would this piece of code do?
change the background color of the word demo to red
change the font color of the demo element to red
this is not correct
styles the element with the class demo
Which of these is a method?
getElementById( )
style
document
color
Which line is missing to return the result of the multiplication 10 x 5 ?
result
number 1 * number 2 ;
let result = 10 x 5 ;
var result = number 1 * number 2 ;
Correct this code so that
Hello!
is displayed in the paragraph
with the id "demo"
add
.style.text
after ("demo")
add
.innerHTML
after ("demo")
add a semi colon after myFunction()
Save "Hello" in a variable first
What is the correct syntax to transform a string to upper case?
var txt = "Hello!" ;
toUpperCase( txt );
var txt = "Hello!" ;
toUpperCase.txt();
var txt = "Hello!" ;
txt.toUpperCase();
var txt = "Hello!" ;
txt(toUpperCase);
Which of these methods removes the last element of an array?
pop( )
splice( );
push( )
split( )
What would this piece of code display?
false
x!=8
true
8
What would this piece of code display?
text
John, Joe, Greg, Ruth
John
Joe
Greg
Ruth
4
What would this piece of code display?
10
20
30
40
1
2
3
4
10
20
30
40
50
11
22
33
44
