To call a function in your code, you would type the function name followed by ______
Parentheses
This type of scope refers to the context where variables are accessible to every part of the program.
Global Scope
This is a type of list in JavaScript which can store any data types such as Strings, numbers, and booleans.
Array
This type of loop usually contains three expressions separated by a semi-colon inside of parentheses.
for loop
True or False
In JavaScript, an Array is a type of object.
True
We can call the same function as many times as needed.
True or False
True
These types of variables exist within block scope and are not accessible to other parts of the program.
Local Variables
Each item inside of an Array is called an ________.
Element
A _____ loop is a loop that is running inside of another loop.
Nested
This method is used to add one or more elements to the end of an Array and returns the new length of the array.
push() method
When declaring a function, we can specify its ______ within parentheses. We use ______ as placeholders for information that will be passed to the function when it is called.
Parameters
______ pollution is when too many variables exist in a namespace or variable names are reused.
Scope
Each element in an array has a numbered position known as its _______.
Index
With this type of loop, the counter variable is declared before the start of the loop and the condition is checked before entering the code block.
While loop
This method removes the last element from an array and returns that element.
pop() method
The values that are passed to the function when it is called are called ______
Arguments
The code below will print _____ to the console.
let num = 50;
function printNum() {
let num = 100;
console.log(num)
}
printNum()
100
This method is used to insert elements to the beginning of an Array.
unshift()
With this type of loop, the condition is checked after the code block is executed ensuring that it runs at least once.
do ... while loop
What will be printed to the console?
let arr = ["red", "blue", ["yellow", "green", "purple"]];
console.log(arr[2][1]);
green
When a _____ statement is used in a function body, the execution of the function is stopped and the code that comes after it will not be executed.
Return
What will be the output of the code below?
function(getName) {
let myName = "Brittany";
}
console.log(myName);
Reference Error: myName is not defined
This method can be used to remove or replace existing elements in an Array or to add elements in place. (modifies the original Array)
splice()
The _____ keyword allows a program to exit completely out of the loop when a condition is met.
Break
What values will the array (const arr) hold after the code runs?
const arr = ["red", "blue", "green"];
arr[0] = "yellow";
["yellow", "blue", "green"]