Index

A note on the digital index

A link in an index entry is displayed as the section title in which that entry appears. Because some sections have multiple index markers, it is not unusual for an entry to have several links to the same section. Clicking on any link will take you directly to the place in the text in which the marker appears.

Symbols

!= operator, Equality
!== operator, Equality, Detecting Primitive Values
== operator, Equality
=== operator, Equality, Detecting Primitive Values

A

Adams, Douglas, Automation
addClass() function, When to Throw Errors
addEventListener() function, Keep JavaScript Out of HTML
addItem() function, Alternative #2: Simple Client-Side Templates
AMD (Asynchronous Module Definition) modules, Asynchronous Module Definition (AMD) ModulesAsynchronous Module Definition (AMD) Modules
Android Code Style Guidelines for Contributors, Line Length
anonymous functions, Immediate Function Invocation
Ant build tool
about, Ant
baking files, Baking FilesBaking Files
build-time compression, Build-Time Compression
build.xml file, The Build FileThe Build File
Buildr project, Buildr
concatenation, The Task
creating build directory, Missing Pieces
installing, Installation
properties, Properties
running the build, Running the Build
target dependencies, Target Dependencies
Apache web server, Runtime Compression
application logic, Rule #1: Separate Application Logic
<apply> task
about, The Task
executable attribute, Minifying with UglifyJS
failonerror property, Improving the Target
parallel attribute, Improving the Target, JSDoc Toolkit
YUI Compressor and, Minifying with YUI Compressor
array literals
about, Array Literals
square brackets and, Array Literals
Array object
forEach() method, Don’t Add New Methods, A Note on Polyfills
isArray() method, Detecting Arrays
length property, Better Approaches
Array reference type, Detecting Reference Values, Detecting Arrays
ASI (automatic semicolon insertion), Statement Termination, Line Breaking
Asynchronous Module Definition (AMD) modules, Asynchronous Module Definition (AMD) ModulesAsynchronous Module Definition (AMD) Modules
automated testing
about, Automated Testing
JsTestDriver utility, JsTestDriverThe Ant Target
PhantomJS engine, PhantomJSThe Ant Target
Yeti tool, Yeti
YUI Test Selenium Server, YUI Test Selenium DriverThe Ant Target
automatic semicolon insertion (ASI), Statement Termination, Line Breaking
automation
advantages and disadvantages, Advantages and Disadvantages
Ant build tool, AntBuildr
assembling final system, Putting It TogetherOther CI Systems
automated testing, Automated TestingThe Ant Target
baking files, Baking FilesBaking Files
code validation, ValidationBuildr Task
compression process, CompressionBuild-Time Compression
concatenation, Concatenation and BakingHeaders and Footers
documentation generators, DocumentationYUI Doc
file and directory structure, File and Directory StructureBasic Layout
minification process, MinificationMinifying with UglifyJS

B

baking files, Baking FilesBaking Files
blank lines
about, White Space
case statement, Indentation
formatting rules for, Blank Lines
multiline comments and, Multiline Comments
block statements
brace alignment, Brace Alignment
curly braces and, Statements and Expressions
spacing around, Block Statement Spacing
BOM (Browser Object Model), What Do You Own?
bookmarklets, The Zero-Global Approach
Booleans
as primitive types, Primitive Wrapper Types, Detecting Primitive Values
typeof operator and, Detecting Primitive Values
braces (see curly braces)
break statement, The for Loop
browser detection
about, Browser Detection
browser inference and, Avoid Browser InferenceAvoid Browser Inference
feature detection, Feature DetectionFeature Detection
feature inference and, Avoid Feature Inference
user-agent detection, User-Agent DetectionUser-Agent Detection
browser inference, Avoid Browser InferenceAvoid Browser Inference
Browser Object Model (BOM), What Do You Own?
browsers
addEventListener() function, Keep JavaScript Out of HTML
Array.isArray() method, Detecting Arrays
commenting browser-specific hacks, Browser-Specific Hacks, Comments
compression and, Runtime Compression
CSS expressions, Keep JavaScript Out of CSS
detecting functions, Detecting Functions
error handling, Throwing Errors in JavaScript
Handlebars templating system, Alternative #3: Complex Client-Side Templates
message property, Error Types
polyfills and, A Note on Polyfills
preventing object modification, Preventing Modification
<script> elements and, Alternative #2: Simple Client-Side Templates
window object and, Avoid Globals
YUI Test Selenium Server and, Using the YUI Test Selenium Driver
build directory, Basic Layout, Missing Pieces
build systems, Ant
(see also Ant build tool)
build directory and, Missing Pieces
build tools, Build Tools
CI systems and, Using a CI SystemOther CI Systems
planning builds, Planning the BuildThe Release Build
build-time compression, Build-Time CompressionBuild-Time Compression
build.xml file
about, The Build FileThe Build File
Buildr tool and, Buildr
example, Planning the Build
Jenkins CI system and, Jenkins
running, Running the Build
target dependencies, Target Dependencies
BuildBot CI system, Other CI Systems
Buildr project
about, Buildr
<closure> task, Minifying with Closure Compiler
<gzipall> task, Build-Time Compression
<jsdoc> task, JSDoc Toolkit
<jshint> task, Buildr Task
<jstestdriver> task, The Ant Target
<phantomjs> task, The Ant Target
<uglifyjs> task, Minifying with UglifyJS
<yeti> task, Yeti
<yuicompressor> task, Minifying with YUI Compressor
<yuidoc> task, YUI Doc
<yuitest-selenium> task, The Ant Target

C

camel case convention, Naming, Variables and Functions
case statement
default, default
falling through, Falling Through
indentation, Indentation
lines around, Indentation
CDN (Content Delivery Network), Best Practices
CI systems
about, Using a CI System
BuildBot, Other CI Systems
Continuum, Other CI Systems
Gradle, Other CI Systems
Jenkins, JenkinsJenkins
client-side templates, Alternative #2: Simple Client-Side Templates
Closure Compiler, Minification, Minifying with Closure CompilerMinifying with Closure Compiler
Closure library, The One-Global Approach, Minifying with Closure Compiler
<closure task>, Minifying with Closure Compiler
Code Conventions for the Java Programming Language
about, Introduction
brace alignment, Brace Alignment
line length, Line Length, Line Length
Code Conventions for the JavaScript Programming Language
about, Useful Tools
array literals, Array Literals
blank lines, Blank Lines, White Space
block statement spacing, Block Statement Spacing
brace alignment, Brace Alignment
continue statement, The for Loop
default case statement, default
equality operators, Equality, Equality Operators
eval() function, eval(), Things to Avoid
falling through switch statements, Falling Through
for-in loops, The for-in Loop
function call spacing, Function Call Spacing
function declarations, Function Declarations, Function Declarations
hasOwnProperty() method, The for-in Loop
immediate function invocation, Immediate Function Invocation
indentation levels, Indentation Levels, Indentation
line length, Line Length, Line Length
naming conventions, Constructors, Naming
object literals, Object Literals, Object Literals
quotation marks for strings, Strings
statement termination, Statement Termination
statements and curly braces, Statements and Expressions
switch statement format, Indentation
variable declarations, Variable Declarations, Variable Declarations
with statement, The with Statement, Things to Avoid
comments
annotating code with, Comment Annotations
blank lines and, Blank Lines
browser-specific hacks and, Browser-Specific Hacks, Comments
difficult-to-understand code and, Difficult-to-Understand Code, Comments
documentation, Documentation Comments, Comments
multiline, Multiline Comments, Documentation Comments, Multiline Comments
potential author errors and, Potential Author Errors, Comments
single-line, Single-Line CommentsSingle-Line Comments, Single-Line Comments
usage considerations, Using CommentsBrowser-Specific Hacks
compound statements, Compound Statements
compression process
about, Compression
build-time, Build-Time CompressionBuild-Time Compression
runtime, Runtime Compression
<concat> task
about, The Task
eol attribute, Line Endings
fixlastline attribute, Line Endings
headers and footers, Headers and Footers
concatenating files
about, The TaskHeaders and Footers
dealing with last lines, Line Endings
config object
about, Externalizing Configuration Data
properties file and, Storing Configuration Data
configuration data
about, What Is Configuration Data?
externalizing, Externalizing Configuration Data
storing, Storing Configuration DataStoring Configuration Data
constants
about, Constants
naming conventions, Constants, Naming
constructors
about, Constructors
naming conventions, Constructors, Naming
Content Delivery Network (CDN), Best Practices
continue statement, The for Loop
Continuum CI system, Other CI Systems
Crockford, Douglas, Useful Tools
(see also Code Conventions for the JavaScript Programming Language)
duck typing, Detecting Arrays
JSLint tool, Useful Tools
CSS
keeping JavaScript out of, Keep JavaScript Out of CSS
keeping out of JavaScript, Keep CSS Out of JavaScript
CSS layer
about, Loose Coupling of UI Layers
keeping JavaScript out of, Keep JavaScript Out of CSS
loose coupling, What Is Loose Coupling?
CSS Lint project, Basic Layout
cssText property, Keep CSS Out of JavaScript
curly braces
aligning, Brace Alignment
object literals and, Object Literals
statements and, Statements and Expressions

D

Date reference type, Detecting Reference Values
decimal points
hanging, Numbers
leading, Numbers
define() function, Asynchronous Module Definition (AMD) Modules
delete operator, Don’t Remove Methods
<delete> task, Missing Pieces
design patterns
about, Better Approaches
facade pattern, The Facade Pattern
observer pattern, Programming Practices
tight coupling and, What Is Loose Coupling?
development builds, Planning the Build, The Development Build
directory structure
basic layout, Basic LayoutBasic Layout
best practices, Best Practices
do...while statement, Statements and Expressions, do Statement
docs subdirectory, Basic Layout, YUI Doc
document object
all property, Avoid Feature Inference, Avoid Browser Inference, Avoid Browser Inference
childNodes property, Avoid Browser Inference
getElementById() method, Detecting Primitive Values, Don’t Override Methods, Don’t Remove Methods, Feature Detection, Avoid Feature Inference
getElementsByClassName() method, Don’t Add New Methods
getElementsByTagName() method, Avoid Feature Inference
uniqueID property, Avoid Browser Inference
documentation comments, Documentation Comments, Comments
documentation generators
about, Documentation Comments, Documentation
additional information, Documentation Generators
JSDoc Toolkit, JSDoc ToolkitJSDoc Toolkit
YUI Doc, YUI DocYUI Doc
Dojo Style Guide
block statement spacing, Block Statement Spacing
brace alignment, Brace Alignment
continue statement, The for Loop
decimal points, Numbers
default case statement, default
falling through switch statements, Falling Through
function call spacing, Function Call Spacing
indentation levels, Indentation Levels
naming conventions, Naming, Constants, Constructors
statement termination, Statement Termination
statements and curly braces, Statements and Expressions
switch statement format, Indentation
variable declarations, Variable Declarations
Dojo Toolkit
error handling, When to Throw Errors
file and directory structure, Basic Layout
module loader, Asynchronous Module Definition (AMD) Modules
one-global approach, The One-Global Approach
DOMWrapper object
addClass() method, The Facade Pattern
classList property, The Facade Pattern
remove() method, The Facade Pattern
doSomething() function, Keep JavaScript Out of HTML
duck typing, Detecting Arrays

E

<echo> element, The Build File
ECMA-262 specification, Error Types
ECMAScript
Array.isArray() method, Detecting Arrays
camel case convention, Naming
function declarations, Function Declarations
modules and, Modules
polyfills and, A Note on Polyfills
preventing modification, Preventing Modification
strict mode, Strict Mode, eval()
type coercion, Equality
with statement, The with Statement
equality operators, EqualityEquality, Equality Operators
Error object
about, Throwing Errors in JavaScript, Error Types
message property, Error Types
types supported, Error TypesError Types
Error reference type, Detecting Reference Values, Throwing Errors in JavaScript
errors, throwing (see throwing errors)
eval() function
about, eval(), Things to Avoid
strict mode and, eval()
EvalError object, Error Types
event handling
about, Event Handling
application logic rule, Rule #1: Separate Application Logic
onclick attribute, Keep JavaScript Out of HTML
passing around event object, Rule #2: Don’t Pass the Event Object AroundRule #2: Don’t Pass the Event Object Around
usage considerations, Classic Usage
event object
about, Classic Usage
clientX property, Classic Usage
clientY property, Classic Usage
passing around, Rule #2: Don’t Pass the Event Object AroundRule #2: Don’t Pass the Event Object Around
<exec> task, YUI Doc, The Ant Target, The Ant Target
expression() function, Keep JavaScript Out of CSS

F

facade pattern, The Facade Pattern
facades, The Facade Pattern
factory functions, YUI modules
feature detection
about, Feature DetectionFeature Detection
browser inference and, Avoid Browser InferenceAvoid Browser Inference
feature inference and, Avoid Feature Inference
suggestions using, What Should You Use?
feature inference
about, Avoid Feature Inference
cautions using, What Should You Use?
file and directory structure
basic layout, Basic LayoutBasic Layout
best practices, Best Practices
<filelist> element
baking files, Baking Files
<filelist> task
concatenating files, The Task
finding files, Finding Files
files
baking, Baking FilesBaking Files
compression process, CompressionBuild-Time Compression
concatenating, The TaskHeaders and Footers
finding, Finding Files
license, Baking Files
minification process, MinificationMinifying with UglifyJS
<fileset> task
concatenating files, The Task
converting into property, Build-Time Compression
finding files, Finding Files, The Task
<jshint> task and, Buildr Task
<phantomjs> task and, The Ant Target
FIXME annotation, Comment Annotations
<footer> element, Headers and Footers
for statement
about, The for Loop, for Statement
break statement and, The for Loop
continue statement and, The for Loop
curly braces and, Statements and Expressions
variable declarations and, Variable Declarations
for-in statement
about, The for Loop, The for-in Loop
hasOwnProperty() method and, The for-in Loop
formatting rules
blank lines, Blank Lines, White Space
function call spacing, Function Call Spacing
indentation levels, Indentation LevelsIndentation Levels, Indentation
line breaking, Line Breaking
line length, Line Length, Line Length
literal values, Literal ValuesArray Literals
naming conventions, NamingConstructors
statement termination, Statement TerminationStatement Termination
function calls, spacing, Function Call Spacing
Function constructor, eval(), Detecting Functions
functions, Function Declarations
(see also global variables and functions; specific functions)
declaring, Function DeclarationsFunction Declarations, Function Declarations
defining, Code Fragility
detecting, Detecting Functions
factory, YUI modules
immediate invocation of, Immediate Function Invocation
naming conventions, Variables and FunctionsVariables and Functions, Naming
new operator and, Constructors
with statement and, The with Statement

G

global object, Avoid Globals
global variables and functions
about, Avoid Globals
code fragility, Code Fragility
creating accidentally, Accidental GlobalsAvoiding Accidental Globals
naming collisions, Naming Collisions
one-global approach, The One-Global ApproachAsynchronous Module Definition (AMD) Modules
problems with, The Problems with GlobalsDifficulty Testing
testing difficulty, Difficulty Testing
zero-global approach, The Zero-Global Approach
Google JavaScript Style Guide
array literals, Array Literals
block statement spacing, Block Statement Spacing
brace alignment, Brace Alignment
eval() function, eval()
for-in loops, The for-in Loop
function call spacing, Function Call Spacing
function declarations, Function Declarations
indentation levels, Indentation Levels
multiline strings, Strings
naming conventions, Naming, Constants, Constructors
object literals, Object Literals
primitive wrapper types, Primitive Wrapper Types
quotation marks for strings, Strings
statement termination, Statement Termination
with statement, The with Statement
Gradle CI system, Other CI Systems
<gzip> task
about, Build-Time Compression
destfile attribute, Build-Time Compression
src attribute, Build-Time Compression
<gzipall> task, Build-Time Compression

H

HACK annotation, Comment Annotations
Handlebars templating system, Alternative #3: Complex Client-Side Templates
hanging decimal points, Numbers
<header> element
about, Headers and Footers
trimleading attribute, Baking Files
Hoare, C.A.R., Programming Practices
HTML layer
about, Loose Coupling of UI Layers
keeping JavaScript out of, Keep JavaScript Out of HTMLKeep JavaScript Out of HTML
keeping out of JavaScript, Keep HTML Out of JavaScript
loose coupling, What Is Loose Coupling?
Hungarian notation, Naming

I

if statement
about, if Statement
curly braces and, Statements and Expressions
immediate function invocation
about, Immediate Function Invocation
strict mode, Strict Mode
importPackage() function, Build-Time Compression
in operator, Detecting Properties, Detecting Properties
indentation levels
about, Indentation Levels, Indentation
case statement, Indentation
line breaking and, Line Breaking
line length and, Line Length, Line Length
spaces for, Indentation Levels
style guide references, Indentation Levels
switch statement, Indentation
tabs for, Indentation Levels
inheritance
object-based, Object-Based Inheritance
prototypal, Object-Based Inheritance
type-based, Type-Based Inheritance
innerHTML property, Keep HTML Out of JavaScript
insertAdjacentHTML() function, Alternative #2: Simple Client-Side Templates
installing
Ant build tool, Installation
JsTestDriver utility, Installation and Usage
PhantomJS engine, Installation and Usage
instanceof operator, Detecting Reference ValuesDetecting Reference Values
integration builds, Planning the Build, The Integration Build

J

Jasmine tests, Installation and Usage
Java properties file, Storing Configuration Data
JavaScript layer
about, Loose Coupling of UI Layers
keeping CSS out of, Keep CSS Out of JavaScript
keeping HTML out of, Keep HTML Out of JavaScript
keeping out of CSS, Keep JavaScript Out of CSS
keeping out of HTML, Keep JavaScript Out of HTMLKeep JavaScript Out of HTML
loose coupling, What Is Loose Coupling?
Jenkins CI system, JenkinsJenkins
jQuery
error handling, When to Throw Errors
facades and, The Facade Pattern
file and directory structure, Basic Layout
loading from server, Alternative #1: Load from the Server
module loader, Asynchronous Module Definition (AMD) Modules
naming conventions, Variables and Functions
one-global approach, The One-Global Approach
jQuery Core Style Guide
block statement spacing, Block Statement Spacing
brace alignment, Brace Alignment
equality operators, Equality
eval() function, eval()
falling through switch statements, Falling Through
function call spacing, Function Call Spacing
indentation levels, Indentation Levels
quotation marks for strings, Strings
statement termination, Statement Termination
statements and curly braces, Statements and Expressions
js subdirectory, Basic Layout
<jsdoc> task
about, JSDoc Toolkit
outputdir attribute, JSDoc Toolkit
templates attribute, JSDoc Toolkit
JSDoc Toolkit, Documentation Comments, JSDoc ToolkitJSDoc Toolkit
<jshint> task
about, Buildr Task
options attribute, Buildr Task
JSHint tool
about, Useful Tools, Linting Tools
accidental globals, Avoiding Accidental Globals
continue statement, The for Loop
decimal points, Numbers
equality operators, Equality
eval() function, eval()
function declarations, Function Declarations
hasOwnProperty() method, The for-in Loop
incorporating into build system, Validation
naming conventions, Constructors
newcap option, Constructors
octal numbers, Numbers
primitive wrapper types, Primitive Wrapper Types
programming practices, Programming Practices
statement termination, Statement Termination
statements and curly braces, Statements and Expressions
strict mode, Strict Mode
JSLint tool
about, Useful Tools, Linting Tools
accidental globals, Avoiding Accidental Globals
continue statement, The for Loop
decimal points, Numbers
equality operators, Equality
eval() function, eval()
function declarations, Function Declarations
hasOwnProperty() method, The for-in Loop
immediate function invocation, Immediate Function Invocation
naming conventions, Constructors
octal numbers, Numbers
primitive wrapper types, Primitive Wrapper Types
programming practices, Programming Practices
statement termination, Statement Termination
statements and curly braces, Statements and Expressions
strict mode, Strict Mode
switch statement format, Indentation
JSONP (JSON with padding), Storing Configuration Data
<jstestdriver> task
about, The Ant Target
config attribute, The Ant Target
outputdir attribute, The Ant Target
JsTestDriver utility, JsTestDriverThe Ant Target

L

leading decimal points, Numbers
Lecomte, Julien, Minification
license files, Baking Files
line formatting rules
blank lines, Blank Lines, White Space
case statement, Indentation
line breaking, Line Breaking
line length, Line Length, Line Length
multiline comments and, Multiline Comments
literal values
about, Literal Values
array literals, Array Literals
null, Null, Undefined
numbers, Numbers
object literals, Object Literals
strings, Strings
undefined, Undefined
<loadfile> task, Baking Files
<loadproperties> element, Properties
local variables
accidental globals and, Accidental Globals
blank lines and, Blank Lines
defining, Variable Declarations
with statement and, The with Statement
loose coupling of UI layers
about, Loose Coupling of UI LayersWhat Is Loose Coupling?
keeping CSS out of JavaScript, Keep CSS Out of JavaScript
keeping HTML out of JavaScript, Keep HTML Out of JavaScript
keeping JavaScript out of CSS, Keep JavaScript Out of CSS
keeping JavaScript out of HTML, Keep JavaScript Out of HTMLKeep JavaScript Out of HTML

N

namespaces
about, Namespaces
creating, Namespaces
one-global approach, NamespacesNamespaces
YUI modules and, YUI modules
naming collisions, Naming Collisions
naming conventions
about, Naming, Naming
constants, Constants
constructors, Constructors
functions, Variables and FunctionsVariables and Functions
variables, Variables and FunctionsVariables and Functions
navigator.userAgent property, User-Agent Detection
new operator, Constructors
newline, terminating statements with, Statement Termination
NodeList collection type, Don’t Add New Methods
null special value
about, Null
avoiding comparisons, Avoid Null ComparisonsDetecting Properties
as primitive types, Detecting Primitive Values, Primitive Literals
setting methods to, Don’t Remove Methods
testing for, Detecting Primitive Values
type coercion and, Equality
typeof operator and, Undefined, Detecting Primitive Values, Detecting Reference Values
Number() casting function, Equality
numbers
about, Numbers
decimal points and, Numbers
octal format, Numbers
as primitive types, Primitive Wrapper Types, Detecting Primitive Values, Primitive Literals
typeof operator and, Detecting Primitive Values

O

object literals
about, Object Literals, Object Literals
curly braces and, Object Literals
Object object
create() method, Object-Based Inheritance
freeze() method, Preventing Modification
hasOwnProperty() method, The for-in Loop, Detecting Properties
isExtensible() method, Preventing Modification
isFrozen() method, Preventing Modification
isSealed() method, Preventing Modification
preventExtension() method, Preventing Modification
seal() method, Preventing Modification
toString() method, Equality, Detecting Arrays
valueOf() method, Equality
object ownership, What Do You Own?
object properties
detecting, Detecting PropertiesDetecting Properties
for-in loop and, The for Loop, The for-in Loop
naming conventions, Naming
with statement and, The with Statement
Object reference type, Detecting Reference Values
object-based inheritance, Object-Based Inheritance
objects, Detecting Reference Values
(see also modifying objects)
about, Detecting Reference Values
detecting arrays, Detecting Arrays
detecting functions, Detecting Functions
detecting reference values, Detecting Reference ValuesDetecting Reference Values
sealing, Preventing Modification
observer pattern, Programming Practices
octal numbers, Numbers
one-global approach
about, The One-Global Approach
AMD modules, Asynchronous Module Definition (AMD) ModulesAsynchronous Module Definition (AMD) Modules
modules, ModulesYUI modules
namespaces, NamespacesNamespaces
YUI modules, YUI modules
operators
equality, EqualityEquality, Equality Operators
line breaking and, Line Breaking
spacing, Operator Spacing
tenary, Ternary Operator
overriding methods, Don’t Override Methods

P

parentheses, Immediate Function Invocation, Parentheses Spacing
parsing minifiers, MinificationMinifying with UglifyJS
Pascal case convention, Constructors
PhantomJS engine, PhantomJSThe Ant Target
<phantomjs> task, The Ant Target
planning builds, Planning the BuildThe Release Build
polyfills (shims), A Note on Polyfills
primitive types
about, Primitive Wrapper Types, Primitive Literals
detecting, Detecting Primitive ValuesDetecting Primitive Values
programming practices
about, Programming Practices
avoiding globals, Avoid GlobalsThe Zero-Global Approach
avoiding null comparisons, Avoid Null ComparisonsDetecting Properties
browser detection, Browser DetectionWhat Should You Use?
event handling, Event HandlingRule #2: Don’t Pass the Event Object Around
loose coupling of UI layers, Loose Coupling of UI Layers
modifying objects, Don’t Modify Objects You Don’t OwnPreventing Modification
separating configuration data from code, Separate Configuration Data from CodeStoring Configuration Data
throwing out errors, Throw Your Own ErrorsError Types
<project> element
default attribute, Running the Build
name attribute, The Build File
project object (Ant)
about, Build-Time Compression
createTask() method, Build-Time Compression
getProperty() method, Build-Time Compression
properties (see object properties)
<property> element
about, Properties
name attribute, Properties
value attribute, Properties
Props2Js tool, Storing Configuration Data
prototypal inheritance, Object-Based Inheritance
Prototype library, Don’t Add New Methods

Q

QUnit tests, Installation and Usage
quotation marks, Strings

R

RangeError object, Error Types
reference values
about, Detecting Reference Values
detecting, Detecting Reference ValuesDetecting Reference Values
detecting arrays, Detecting Arrays
detecting functions, Detecting Functions
ReferenceError object, Avoiding Accidental Globals, Error Types
release builds, Planning the Build, The Release Build
<replaceregexp> task
about, Baking Files
byline attribute, Baking Files
flags attribute, Baking Files
match attribute, Baking Files
replace attribute, Baking Files
require() function, Asynchronous Module Definition (AMD) Modules
RequireJS module loader, Asynchronous Module Definition (AMD) Modules
return statement, return Statement
REVIEW annotation, Comment Annotations
Rhino engine, The Task
runtime compression, Runtime Compression

S

<script element>
embedding JavaScript in HTML, Keep JavaScript Out of HTML
<script> element
embedding JavaScript in HTML, Keep JavaScript Out of HTML
language attribute, Build-Time Compression
text property, Alternative #2: Simple Client-Side Templates
type property, Alternative #2: Simple Client-Side Templates, Alternative #3: Complex Client-Side Templates
scripts
naming collisions in, Naming Collisions
PhantomJS engine support, PhantomJS
strict mode, Strict Mode
zero-global approach, The Zero-Global Approach
semicolons
terminating statements with, Statement Termination
variable declarations and, Accidental Globals
setInterval() function, eval()
setTimeout() function, eval(), Feature Detection
shims (polyfills), A Note on Polyfills
single-line comments, Single-Line CommentsSingle-Line Comments, Single-Line Comments
Souder, Steve, Keep JavaScript Out of CSS
spaces for indentation levels, Indentation Levels
spacing rules
block statements, Block Statement Spacing
function calls, Function Call Spacing
operators, Operator Spacing
parentheses, Parentheses Spacing
white space, White Space
SproutCore Style Guide
brace alignment, Brace Alignment
equality operators, Equality
function call spacing, Function Call Spacing
indentation levels, Indentation Levels
naming conventions, Naming, Constants
statements and curly braces, Statements and Expressions
variable declarations, Variable Declarations
square brackets, array literals and, Array Literals
src directory, Basic Layout, Finding Files, YUI Doc
<srcfile> element, The Task, Minifying with YUI Compressor
statements, Block Statement Spacing
(see also specific statements)
about, Simple Statements
blank lines and, Blank Lines
block statement spacing, Block Statement Spacing
brace alignment, Brace Alignment
compound, Compound Statements
curly braces and, Statements and Expressions
terminating, Statement Termination
storing configuration data, Storing Configuration DataStoring Configuration Data
strict mode
about, Strict Mode
avoiding accidental globals, Avoiding Accidental Globals
immediate function invocation, Strict Mode
preventing object modification, Preventing Modification
with statement and, The with Statement
String.toUpperCase() method, Primitive Wrapper Types
strings
about, Strings
multiline, Strings
as primitive types, Primitive Wrapper Types, Detecting Primitive Values, Primitive Literals
quotation marks and, Strings
typeof operator and, Detecting Primitive Values
style guidelines
about, Why Style Guidelines?
basic formatting, Basic FormattingArray Literals
comments, CommentsDocumentation Comments, Comments
functions, Function Declarationseval()
operators, EqualityEquality
primitive wrapper types, Primitive Wrapper Types
statements and expressions, Statements and ExpressionsThe for-in Loop
useful tools, Useful Tools
variables, Variable DeclarationsVariable Declarations
style object, Keep CSS Out of JavaScript
switch statement
about, The switch Statement, switch Statement
default, default
falling through, Falling Through
indentation, Indentation
SyntaxError object, Error Types

T

tabs for indentation levels, Indentation Levels
<target> element
depends attribute, Target Dependencies
name attribute, The Build File
<targetfile> element, Minifying with YUI Compressor
templates, client-side, Alternative #2: Simple Client-Side Templates
tenary operator, Ternary Operator
terminating statements, Statement Termination
test directory, Basic Layout
testing
automated, Automated TestingThe Ant Target
event handling and, Rule #1: Separate Application Logic
global variables and functions, Difficulty Testing
for null special value, Detecting Primitive Values
for sort() method, Detecting Arrays
tools supporting, Testing Tools
YUI Test Selenium Server and, Using the YUI Test Selenium DriverUsing the YUI Test Selenium Driver
<tests> element, Using the YUI Test Selenium Driver
tests subdirectory, Basic Layout
throw operator, Throw Your Own Errors, Throwing Errors in JavaScript
throwing errors
about, Throw Your Own ErrorsThrowing Errors in JavaScript
advantages of, Advantages of Throwing Errors
determining when, When to Throw ErrorsWhen to Throw Errors
error types, Error TypesError Types
rules of thumb, When to Throw Errors
try-catch statement and, The try-catch Statement
timestamps, Headers and Footers
TODO annotation, Comment Annotations
try-catch statement
about, try Statement
curly braces and, Statements and Expressions
error handling and, Throwing Errors in JavaScript, The try-catch StatementThrow or try-catch?
type coercion, EqualityEquality
type-based inheritance, Type-Based Inheritance
TypeError object, Error Types
typeof operator
basic syntax, Detecting Primitive Values
detecting functions, Detecting Functions
detecting reference values, Detecting Reference Values
null special value and, Undefined, Detecting Primitive Values, Detecting Reference Values
primitive types and, Detecting Primitive ValuesDetecting Primitive Values
undefined special value and, Undefined, Detecting Primitive Values, Primitive Literals

U

UglifyJS minifier, Minification, Minifying with UglifyJSMinifying with UglifyJS
<uglifiyjs> task
about, Minifying with UglifyJS
outputdir attribute, Minifying with UglifyJS
UI layers, Loose Coupling of UI Layers
undefined special value
about, Undefined
as primitive types, Detecting Primitive Values, Primitive Literals
type coercion and, Equality
typeof operator and, Undefined, Detecting Primitive Values, Primitive Literals
Unofficial Ruby Usage Guide, Line Length
URIError object, Error Types
<url> element, Using the YUI Test Selenium Driver
user-agent detection
about, User-Agent DetectionUser-Agent Detection
browser inference and, Avoid Browser InferenceAvoid Browser Inference
cautions using, What Should You Use?

V

validation
<apply> task and, The Task
finding files, Finding Files
improving, Improving the TargetOther Improvements
var statement
about, Variable DeclarationsVariable Declarations
accidental globals and, Accidental Globals
variable declaration hoisting, Variable Declarations
variables, Variable Declarations
(see also global variables and functions)
assigning values to, Assignments
avoiding null comparisons, Avoid Null ComparisonsDetecting Properties
blank lines and, Blank Lines
declaring, Variable DeclarationsVariable Declarations, Accidental Globals, Variable Declarations
line breaking and, Line Breaking
naming conventions, Variables and FunctionsVariables and Functions, Naming
type coercion and, EqualityEquality

W

while statement
about, while Statement
curly braces and, Statements and Expressions
white space, White Space
window object
ActiveXObject property, Avoid Feature Inference, Avoid Browser Inference
name property, Accidental Globals
overloading in browsers, Avoid Globals
requestAnimationFrame() method, Feature Detection
XMLHttpRequest property, Avoid Browser Inference
with statement
about, Things to Avoid
strict mode and, The with Statement
wrappers, The Facade Pattern

X

XMLHttpRequest object, Alternative #1: Load from the Server
XXX annotation, Comment Annotations

Y

<yeti> task, Yeti
Yeti tool, Yeti
YUI class
add() method, YUI modules
use() method, YUI modules
YUI Compressor, MinificationMinifying with YUI Compressor
YUI Doc, YUI DocYUI Doc
YUI library
commenting browser-specific hacks, Browser-Specific Hacks
commenting difficult-to-understand code, Difficult-to-Understand Code
commenting potential author errors, Potential Author Errors
error handling, When to Throw Errors
facades and, The Facade Pattern
file and directory structure, Basic Layout
loading from server, Alternative #1: Load from the Server
namespaces, Namespaces
one-global approach, The One-Global Approach
YUI Doc and, YUI Doc
YUI modules, YUI modules
YUIDoc tool, Documentation Comments
YUI modules, YUI modules
YUI Test Selenium Server
about, YUI Test Selenium Driver
creating Ant target, The Ant Target
setting up, Setting Up a Selenium Server
usage considerations, Using the YUI Test Selenium DriverUsing the YUI Test Selenium Driver
<yuicompressor> task
about, Minifying with YUI Compressor
outputdir attribute, Minifying with YUI Compressor
<yuidoc> task
about, YUI Doc
inputdir attribute, YUI Doc
outputdir attribute, YUI Doc
YUIDoc tool, Documentation Comments
<yuitest-selenium> task, The Ant Target

Z

Zaytsev, Juriy, Detecting Arrays
zero-global approach, The Zero-Global Approach