Presentation is loading. Please wait.

Presentation is loading. Please wait.

LESSON 13 – INTRO TO ARRAYS

Similar presentations


Presentation on theme: "LESSON 13 – INTRO TO ARRAYS"— Presentation transcript:

1 LESSON 13 – INTRO TO ARRAYS
UNIT 5 – FRIDAY, JAN 12, 2018

2 VOCABULARY ALERT! Array - A data structure in JavaScript used to represent a list. List - A generic term for a programming data structure that holds multiple items.

3

4 PURPOSE: Identify an array as a data structure used to store lists of information in programs. Create arrays and access information stored within them using an index. Manipulate an array using the append, insert, and remove operations. Account for the fact that JavaScript arrays are zero- indexed when using them in a program.

5 Some sort of list data structure is a component of almost all programming languages. 

6  A list allows large amounts of information to be easily referenced and passed around a program, and the use of a numeric index allows individual items in a list to be accessed.

7 A JavaScript array is actually another example of abstraction
A JavaScript array is actually another example of abstraction. We know that it is holding a list of related information, but we don’t need to think about the actual implementation details.

8 What makes lists useful in everyday life
What makes lists useful in everyday life? Today we’re going to start looking at how we can use lists in programs, but before we dive into that, let’s think about why we would want to in the first place. What are the benefits of creating lists? Why is it helpful to keep information in lists?

9 Lists are helpful because:
Lists help us organize information. Lists help us collect all the relevant information in one place. Lists show that a lot of ideas are related. Lists help us order or prioritize ideas. Lists help us think about the big picture.

10 Variables are a bad way to store lists
Variables are a bad way to store lists. Right now, the only way we know how to store information in our programs is with a variable, but each variable can only store a single piece of information.

11 There are a lot of benefits to keeping lists of information in real life. Since we use programming to solve a lot of similar problems, we would like to keep lists of information in our programs, too.

12 Today you’ll be learning about a new programming construct that will allow us to hold as many pieces of information as you want within a single list. This is an array.

13 Learn how to design arrays to hold a variety of information
Learn how to design arrays to hold a variety of information. Access information in an array by its index. Develop a simple application that uses an array.

14 Open Code Studio Watch the different videos, and do each step
Open Code Studio Watch the different videos, and do each step! There are a lot of steps, but you should be able to work through them easily.

15 When to use a variable and when to use an array:
Variables store single pieces of information, while arrays store many. An array can grow in size to accommodate more information. Arrays are slightly more complex to use than variables. If you are only going to be storing a small and fixed amount of information, it is probably appropriate to use multiple variables.

16 TURN IN FOR A GRADE: #7 – myNumbers #14 – removing items #26 – favorite things #29 – user adds stuff but remains in bounds


Download ppt "LESSON 13 – INTRO TO ARRAYS"

Similar presentations


Ads by Google