What does a For loop do?
Answer = Traverses a List
What does the following code output?
for (i=0; i<5; i++) {
if (i<=2) {
console.log(“Hi”);
} else {
console.log(“Hello”);
}
}
Answer = “Hi” “Hi” “Hi” “Hello” “Hello”
What do you put inside the parentheses of a while loop?
Answer= a conditional
Give any example of a built-in function
Answer= valid answer
What is the point in having a function in code?
Answer =To not have duplicated code and to easily repeat code
What is the definition of append?
Answer = add as an attachment
What does the following code segment output?
var myList = [“Jo”, “Jeri”, “Lise”, “Danil”, “Mika”, “Lena”];
console.log(myList[2]);
Answer= “Lise”
In what order are these declared in a for loop? Counter Variable, Variable Update, Condition.
Answer=Counter Variable, Condition, Variable Update
How can you get information from a text box?
Answer = getProperty or getText
What does the list filter pattern do?
Answer= It filters a list
How are indexes and elements different?
Answer = Indexes are the position of an element in a list, whereas elements are the things stored in the list themselves.
On the fourth iteration of this loop, what is the value of i ?
for (i=3; i<20; i=i+2) {
}
Answer = 9
What must you declare before creating a while loop?
Answer= A counter variable
How do you extract information from a dataset?
Answer= getcolumn
What is this loop called?
var steps = 0;
while(steps < 4){
moveForward()
steps++;
};
Answer = while loop