Javascript Control - Arrays - Functions - Prototype OO




CS174

Chris Pollett

Nov 2, 2022

Outline

typeof, Assignments, and the Date Object

I/O

Control Statements

Objects

Arrays

More Arrays

Functions

Function Example

function swap(i, j, a)
{
	var tmp=a[i]; /* explicitly defined variables 
                         have scope within the function
                         if I had declared the variable 
                         implicitly it would have global scope */
	a[i] = a[j]; a[j] = tmp;
}

Constructors

Methods

In-Class Exercise

More on the Prototype Property