Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 5 Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc.Slide 1.

Similar presentations


Presentation on theme: "Chapter 5 Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc.Slide 1."— Presentation transcript:

1 Chapter 5 Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc.Slide 1

2 Objectives Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 2

3 The syntax for creating an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 3

4 The syntax for creating an array and assigning values in one statement Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 4

5 The syntax for referring to an element of an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 5

6 One property and one operator for an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 6 length – the number of elements in the array delete – deletes the contents of an element and sets the element to undefined, but doesn’t remove the element from the array.

7 How to add an element to an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 7

8 How to delete an element at a specific index Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 8

9 Code that puts 1 through 10 into an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 9

10 The message that’s displayed Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 10

11 Code that gets the sum and average of an array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 11

12 The message that’s displayed Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 12

13 The syntax of a for-in loop Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 13

14 The message that’s displayed Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 14

15 The difference between for and for-in loops Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 15

16 The messages that are created by the loops Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 16

17 Terms Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 17

18 Six of the methods of an Array object Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 18 Push(element_list) – Adds one or more elements to the end of the array, and returns the new length of the array. Pop() – removes the last element in the array, decrements the length, and the element that it removed Unshift(elements_list) – adds one or more elements to the beginning of the array and returns the new length of the array Shift() – Removes the first element in the array, decrements the array length, and returns the element that it removed Join(seperator) – when no parameter is passed, this method converts all the elements of the array to strings and concatenates them seperated by commas. To change the seperator, you can pass this method a string literal toString() – Same as the join method without any parameter passed to it.

19 How to use the push and pop methods Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 19

20 How to use the unshift and shift methods Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 20

21 How to use the join and toString methods Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 21

22 The Email List app with state code validation Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 22

23 The HTML file for the page Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 23

24 The JavaScript for the application Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 24

25 The JavaScript for the application (continued) Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 25

26 Extra 5-1: Use a Test Score array Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 26

27 Extra 5-2: Develop a To Do List application Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 27

28 Extra 5-3: Use Sales arrays Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 28

29 Short 5-1: Use Test Score arrays Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc. Slide 29


Download ppt "Chapter 5 Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc.Slide 1."

Similar presentations


Ads by Google