Lists and Loops Review-Code.org

Lists and Loops Review-Code.org

10th Grade - University

12 Qs

quiz-placeholder

Similar activities

JavaScript

JavaScript

University

14 Qs

Data

Data

9th Grade - University

11 Qs

HTML Basics

HTML Basics

7th - 10th Grade

10 Qs

Tin 11(T3-T4)

Tin 11(T3-T4)

11th Grade

10 Qs

Code.org Lists

Code.org Lists

9th - 12th Grade

9 Qs

Lists, Loops & Traversals

Lists, Loops & Traversals

9th - 12th Grade

9 Qs

CSP Loops Lists Traversals

CSP Loops Lists Traversals

9th - 12th Grade

9 Qs

Linux-2 Quiz 2 -- LAMP

Linux-2 Quiz 2 -- LAMP

1st - 12th Grade

15 Qs

Lists and Loops Review-Code.org

Lists and Loops Review-Code.org

Assessment

Quiz

Computers

10th Grade - University

Medium

Created by

JACKY WERNZ

Used 6+ times

FREE Resource

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

var list = [10, 5, 15];


for(var i=0; <INSERT CODE>; i++){

console.log(list[i]);

}

Which of the following will result in ONLY all the items in list being printed to the console if placed where the program reads <INSERT CODE> and the program is run?

i < list [list.length]

i < list.length

i < list [0]

i < list [1]

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

var numList = [10,20,30];

console.log ( numList [numList.length-1]);

What will be displayed in the console when this program runs?

2

3

20

30

3.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

wordList is a list of words that currently contains the values ["tree", "rock", "air"] Which of the following lines will result in the list containing the values ["air", "rock", "air"] ?

wordList[0] = wordList[2]

wordList[2] = wordList[0]

insertItem(wordList, 0, "air")

removeItem(wordList,0)

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

var numbersList = [20, 10, 5]

appendItem(numbersList, 50)

appendItem(numbersList,100)

removeItem(numbersList,1)

insertItem(numbersList, 0, 30)


console.log(numbersList.length)

What will be displayed when this program finishes running?

3

6

7

5

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

var count = 0

while (count != 5){

console.log(count);

count = count + 2;

}

What will be displayed in the console when the following program runs?

0

2

4

6

0

2

4

2

4

6

The program will result in an infinite loop.

6.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

for(var i = 0; i < 4; i++){

console.log(i);

}

What will the following program display in the console?

0

1

2

3

0

1

2

3

4

1

2

3

1

2

3

4

7.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

var sum = 0;

for(var i = 0; i < 5; i++){

sum = sum + i;

}

console.log(sum);

What will the following program display in the console?

0

5

10

15

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?