# jschap03 - Chapter 3 Data Types and Operators JavaScript...

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

Chapter 3: Data Types and Operators JavaScript - Introductory

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

View Full Document
Tutorial3Calculator.html
Section A: Using Data Types and Arrays

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

View Full Document
Objectives In this section, students will learn: How to use data types About numeric data types About Boolean values How to use strings How to use arrays
Data Types Data type is the specific category of information that a variable contains Data types that can be assigned only a single value are called primitive types JavaScript supports five primitive data types: Integer numbers Floating-point numbers Boolean values Strings Null value

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

View Full Document
Primitive Types
Data Types Programming languages that require you to declare the data types of variables are called strongly-typed programming languages Strong typing is also known as static typing Programming languages that do not require you to declare the data types of variables are called loosely-typed programming languages Loose typing is also known as dynamic typing since data types change after being declared

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

View Full Document
Values Returned by Typeof () Operator
PrintDataTypes.html

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

View Full Document
Numeric Data Types An integer is a positive or negative number with no decimal places Integer values in JavaScript can range from -90071992654740992(-2 53 ) to 9007199254740992 (2 53 ) A floating-point number contains decimal places or is written using exponential notation
Numeric Data Types Exponential notation , or scientific notation , is a way of writing very large numbers or numbers with many decimal places using shortened format Floating-point values that exceed the largest positive value of + 1.7976931348623157 x 10 308 result in a special value of Infinity

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

View Full Document
Boolean Values A Boolean value is a logical value of true or false You can also think of a Boolean value as being yes or no , or on or off . Boolean values are most often used for decision making and comparing data Only the words true and false can be used to indicate Boolean values Boolean values get their name from the 19th century mathematician George Boole
Program That Returns a Boolean Value to an Event Handler

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

View Full Document
LiteralStrings Program
Strings A text string contains zero or more characters surrounded by double or single quotation marks There is no special data type in JavaScript for a single character, such as the char data type in the C, C++, and Java programming languages Take extra care when using single quotations with possessives and contractions in strings JavaScript interpreter always looks for the first closing single or double quotation mark to match an opening single or double quotation mark

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

View Full Document
Output of LiteralStrings Program in a Web Browser
Strings An escape character tells the compiler or interpreter that the character that follows it has a

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.

## This note was uploaded on 06/13/2011 for the course MIS 241 taught by Professor Tse during the Spring '11 term at Moraine Valley Community College.

### Page1 / 61

jschap03 - Chapter 3 Data Types and Operators JavaScript...

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

View Full Document
Ask a homework question - tutors are online