FunctionsRandom

# FunctionsRandom - Number.POSITIVE_INFINITY...

This preview shows pages 1–6. Sign up to view the full content.

ANNOUNCEMENTS No posting of code in the forum Check class announcements daily 1

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

View Full Document
2 DATA TYPES Primitive data types in JavaScript Numbers Strings Booleans Composite Data Types Objects Arrays All numbers are represented as floating-point values. To represent a single character using a string of length 1 You can use ‘ ‘ or “ “ for strings although we will use “ “ in this class Remember floating-point values are approximations Special numeric values Infinity Number.NaN Not a Number Number.MAX_VALUE maximum value possible Number.MIN_VALUE smallest (closest to zero) number

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Number.POSITIVE_INFINITY Number.NEGATIVE_INFINITY Example: NumericValues.html 3 GENERATION OF RANDOM VALUES Example: RandomValues.html 4 FUNCTIONS AS DATA In JavaScript functions are considered data. That means they can be assigned to variables, passed as arguments to functions, etc. Example: FunctionsAsDataI.html, FunctionsAsDataII.html 5 THROWING DIES Define a function that returns a number between 1 and 6 simulating the throwing of a die Define a second function that simulates throwing two dies IN-CLASS LAB (20 MINUTES) 6...
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 / 6

FunctionsRandom - Number.POSITIVE_INFINITY...

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

View Full Document
Ask a homework question - tutors are online