Search Header Logo
Big ideas: Lists

Big ideas: Lists

Assessment

Presentation

Computers

9th Grade - University

Medium

Created by

Samuel Stansbery

Used 1+ times

FREE Resource

2 Slides • 7 Questions

1

Big ideas: Lists

Slide image

2

Some big ideas:

  • lists are used to hold collections of variables

  • list help organize variables that can be accessed through the list's index

  • javaScript has built-in functions that allow you to add, remove, and replace items

3

Multiple Choice

Question image

What is the error in line 10?

1

pizza is not a pet

2

quotation marks should not have been used

3

you can only have 3 elements in a list

4

you need to replace the parenthesis with a square bracket

4

Multiple Choice

Question image

Which line of code will print bear to the console?

1

console.log(animals[4)];

2

console.log(animals[3)];

3

console.log(animals[5)];

5

Multiple Choice

Question image

Give the pictured list, what will the variable numOfAns get?


numOfAns = animals.length;

1

3

2

4

3

5

4

6

6

Multiple Select

Let's say you have declared the following empty list:


var evenNumbers = [];


Which lines of code will add an item to the list?

1

evenNumbers = 5;

2

appendItem(evenNumbers, 5);

3

evenNumbers[0] = 5;

7

Multiple Choice

what value is given to letter?


var month = "December"

var letter = month[5];

1

c

2

e

3

m

4

b

8

Multiple Choice

What happens when the rightButton is clicked twice?

var colors["yellow", "red", "blue"];

var index = 0;

onEvent("rightButton", "click", function( ) {

colors[index + 1];

}

1

move to yellow in the list

2

move to red in the list

3

move to blue in the list

4

move out of bounds

9

Multiple Choice

Consider the following code:


[1]: var colors = ["yellow", "red", "blue"];

[2] removeItem(colors, 0);

[3] appendItem (colors, "purple");

[4] insertItem(2, "yellow");

1

["red", "blue", "purple"]

2

["red", "purple","blue", "yellow"]

3

["red", "yellow", "blue","purple"]

4

["red", "blue", "yellow", "purple"]

Big ideas: Lists

Slide image

Show answer

Auto Play

Slide 1 / 9

SLIDE