Lect23TwoDimArraysCookies - Announcements No posting of...

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

View Full Document Right Arrow Icon
Announcements No posting of code in the forum Check class announcements daily 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Two-Dimensional Arrays JavaScript does not support actual two-dimensional arrays You can simulate two-dimensional arrays by using arrays of arrays About two-dimensional arrays You can pass them and return them from functions like one-dimensional arrays Any modifications in the function will be permanent You can have ragged arrays Nested loops (in particular for loops) are used with two-dimensional arrays Example: TwoDimensionalArrays.html Example: Let’s define a two-dimensional array of strings
Background image of page 2
3 onload/onunload onload Allow us to execute code when the page is loaded Example: clock.html, clock.js, clock.css onunload Allow us to execute code when the user navigates away from a web page Example: clockPopUp.html
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Objects Object entity with values and operations Example of objects: document (document.writeln) You use the . (period) operator to access an object’s properties <OBJECT>.<PROPERTY> A property value can be any data type we have seen including objects You can create your own objects by either: var myObj = {}; var myOtherObj = new Object(); You can create properties by assigning a value to it (we do not use var) myObj.created = “Monday”; You can update the property by assigning a new value You can delete a property with the delete operator delete myObj.created; You can check for the existence of a property using the “in” operator Example: ObjectEx.java
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/04/2010 for the course CMSC cmsc122 taught by Professor Perez during the Fall '10 term at University of Maryland Baltimore.

Page1 / 13

Lect23TwoDimArraysCookies - Announcements No posting of...

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

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