Lecture17_JavaScript6

Lecture17_JavaScript6 - Computer Applications for Business...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Applications for Business Spring 2008 Instructor: Gayatree Ganu
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
JavaScript: Lecture 7 Arrays Need Declaration Assignment Index and Value Accessing array elements Types of array Using Arrays with loops Array Examples
Background image of page 2
Arrays The Array object is used to store a set of values in a single variable name. An array is an ordered collection of data Each element of the array can be considered as a variable and each stores a value.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Arrays Need: Grouping similar variables under one name Reduction in the number of different variables required When used with loops, lines of code reduced Can be used when length of input is not known
Background image of page 4
Array Declaration and Assignment Declaration Syntax var array_name = new Array ( array_size); array_name: Any valid array name is permitted. The rules are the same as those for variable names array_size: Size of the array. Parentheses can be left empty if the size of the array is not known beforehand.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
var singer = new Array(10); A array called singer is created This array has length or size 10 and holds names of 10 singers. The singers can be referenced as singer[0],
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 21

Lecture17_JavaScript6 - Computer Applications for Business...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online