FunctionsIII

FunctionsIII - main(); function main() { alert(Done); } The...

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 Make sure you finish the examples we are doing in class. If you have any questions, please see a TA ASAP 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
EXAMPLE Let’s implement the example from last time 2
Background image of page 2
3 PASSING VALUES TO FUNCTION Mechanism used to pass values to function is called pass-by-value Parameters Variables that receive data There are normal variables Arguments Values you pass to a function Example: PassByValue.html Does it matter how we name the parameters?
Background image of page 3

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

View Full DocumentRight Arrow Icon
DEFINING FUNCTIONS ERRORS Make sure your main function is being called
Background image of page 4
Background image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: main(); function main() { alert(Done); } The function reads values that are already provided via parameter(s) The function prints values that are supposed to be returned Not all functions need a return statement Missing argument(s) when calling the function As you define functions: Before adding code to a function, make sure you can call it (e.g., use alert in function to verify the function is being called) Do not define functions inside of functions 4 IN-CLASS LAB (25 MINUTES) 5...
View Full Document

This note was uploaded on 01/12/2012 for the course CMSC 122 taught by Professor Staff during the Fall '08 term at Maryland.

Page1 / 5

FunctionsIII - main(); function main() { alert(Done); } The...

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