Objects Flashcards
The individual instructions in JavaScript are referred to as functions.
True or False?
False
Which of the following is the proper symbol to reference at the beginning of a section of comments that includes multiple lines?
//
*/
/*
(/)
/*
You need to write code that will increase the value of a variable by 5. Which of the following is valid? Choose all that apply.
=+5
+=5
++5
+5
+=5 and +5
Which of the following operators is used to reduce the amount of code that would normally be required for an IF statement in JavaScript?
Ternary
Equality
Numeric
Data
Ternary
Which of the following loops is preferred due to a decreased amount of code to execute the same functionality?
For
If
While
Do while
For
Which of the following is not accurate syntax?
Function myFunction()
function myFunction()
new function ()
new object()
function myFunction()
Given the following array, var cars = [“Volvo”, “Mazda”, “Toyota”] how would you access the value of Mazda?
Cars[Mazda]
Cars[2]
Cars[3]
None of the above
None of the above
Which of the following uses the best practices for casing in JavaScript?
myVariableName
myFUNCTION
MyFunctionName
MyFunctionName
myVariableName
In a JavaScript IF statement the parentheses indicate the code to be executed if the condition evaluates to True.
True or False?
False
Which option is available to prevent code developers from having to write large if statements that have multiple else if clauses?
Slice
For loop
Do…while
Switch
Switch
To create a loop or iteration you can simply replace the word if with which of the following?
Function
Variable
While
For
While
Which of the following is the most frequently used type of loop?
If
While
Do…while
For
For
Which of the following is incredibly important when creating a loop to ensure that you don’t write an infinite loop?
Check the condition
Increment the variable
Set the index
None of the above
Increment the variable
You want to create a reusable section of JavaScript code that you can associate with an object. What keyword should you use to begin?
Formula
Method
Function
Property
Function
Which of the following keywords will terminate the current iteration of the loop when it is encountered but not the loop itself?
Break
Continue
Switch
End
Continue