Teste

Disponível somente no TrabalhosFeitos
  • Páginas : 3 (736 palavras )
  • Download(s) : 0
  • Publicado : 13 de novembro de 2012
Ler documento completo
Amostra do texto
javascript_reference_card.qxd

8/13/04

11:41 AM

Page 1

Addison-Wesley’s

JavaScript Reference Card
Kathleen M. Goelz and Carol J. Schwartz, Rutgers University
Javascript: A scriptinglanguage designed to be integrated
into HTML code to produce enhanced, dynamic, interactive web pages.

DATA TYPES
Definition: The classification of values based on the specific
categories inwhich they are stored.
Primitive Types: String, Boolean, Integer, Floating Point,
Null, Void
Composite Types: Object, Array, Function. Composite data
types are in separate sections of the code.NUMERIC
Integer: Positive or negative numbers with no fractional
parts or decimal places.
Floating Point: Positive or negative numbers that contain a
decimal point or exponential notations.
String:A sequence of readable characters or text, surrounded by single or double quotes.
Boolean: The logical values True/False, etc. used to compare data or make decisions.
Null: The variable does nothave a value; nothing to report.
Null is not the same as zero, which is a numeric value.
Casting: Moving the contents of a variable of one type to a
variable of a different type. You don’t move thecontents to
a different variable; it stays in the same variable but the
data type is changed or “re-cast”.

VARIABLES
Definition: A placeholder for storing data. In JavaScript, a
declarationstatement consists of the reserved word var and
the name (identifier) of one or more variables.
Format:
var variable_name
[var command is used to declare (create) variables]
Examples:
varmyHouseColor
var myAddress
var vacation_house, condominium,
primaryResidence
Rules for Naming Variables:
1. Variables cannot be reserved words.
2. Variables must begin with a letter or underscore andcannot begin with symbols, numbers, or arithmetic
notations.
3. Spaces cannot be included in a variable name.
Hints:
1. Although variables in JavaScript can be used without
being declared, it is...
tracking img