WorksheetsGMetrix Session 2 JavaScript Exam
Total questions: 12
Worksheet time: 6mins
An undefined variable is an empty variable that has been declared, but has never had a value. This is does not have: a number, a Boolean value, and a ________
string value
a letter
a symbol
a pet cat
Variables do not need to be converted, whereas objects in JavaScript need to be converted before they can be used in a calculation
True
False
In JavaScript, a declaration is the act of creating a new variable. What defines the initialization process?
Storing an object
Creating an object
Storing a value in a variable
initialing an object
Which is an example of a sorting statement used to sort an array in JavaScript? (check the syntax!)
sort.array();
tuningList.sort();
sort();
tuningArray.sort
The Math.abs method in JavaScript is used to perform which function? (check w3schools)
Create an absolute value
Make a variable an absolute value
create a variable with an absolute value
Make a number represent absolute value
A keyword declared without a var keyword is considered to be which type of variable?
Local
Implicit
Global
Explicit
document.write(incMsg);
Strings can be used to store text, numbers, and other characters. Is the above code an example of a string variable?
Yes
No
An array in JavaScript is a(n) ________ with multiple containers that holds multiple _______
value; objects
variable; values
object; values
cup; drinks
Which is an example of a pop command using the JavaScript console?
tuningList.pop();
drinkDietCoke.pop
.pop();
pop();
Which best defines the purpose of the floor method?
Used to change numbers to the nearest lower whole number
Used to change numbers to the nearest higher whole number
Used to change numbers to the nearest lower integer
Used to change numbers to the nearest higher integer
The main purpose of a ________ is to create reusable code.
function
object
property
event
if x = 5 and y = x then y=7, what sill x be?
(in this scenario, think of y = x as a boolean (true vs false)
Null
Undefined
5
7
