Definitions
Code Analysis
Syntax
Built-in Functions
Miscellaneous
100

What does a For loop do?

 Answer = Traverses a List 

100
  1. 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”

100

What do you put inside the parentheses of a while loop?

Answer= a conditional

100

Give any example of a built-in function

Answer= valid answer

100

What is the point in having a function in code?

Answer =To not have duplicated code and to easily repeat code

200

What is the definition of append?

Answer = add as an attachment

200

What does the following code segment output?

    var myList = [“Jo”, “Jeri”, “Lise”, “Danil”, “Mika”, “Lena”];

console.log(myList[2]);

Answer= “Lise”

200

In what order are these declared in a for loop? Counter Variable, Variable Update, Condition.

Answer=Counter Variable, Condition, Variable Update

200

How can you get information from a text box?

Answer = getProperty or getText

200

What does the list filter pattern do?

 Answer= It filters a list

300

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.

300

On the fourth iteration of this loop, what is the value of i ?

    for (i=3; i<20; i=i+2) {

}



 Answer = 9

300

What must you declare before creating a while loop?

Answer= A counter variable

300

How do you extract information from a dataset?

Answer= getcolumn

300

What is this loop called?

    var steps = 0;

while(steps < 4){

moveForward()

steps++;

};

Answer = while loop