PacktLib: Object-Oriented JavaScript - Second Edition

Object-Oriented JavaScript Second Edition

Credits

About the Authors

About the Reviewer

www.PacktPub.com

Preface

Object-oriented JavaScript

A bit of history

ECMAScript 5

Object-oriented programming

OOP summary

Setting up your training environment

Summary

Primitive Data Types, Arrays, Loops, and Conditions

Variables

Operators

Primitive data types

Strings

Booleans

Logical operators

Comparison

Primitive data types recap

Arrays

Conditions and loops

Code blocks

Switch

Loops

Comments

Summary

Exercises

Functions

What is a function?

Scope of variables

Functions are data

Closures

Summary

Exercises

Objects

From arrays to objects

Built-in objects

Summary

Exercises

Prototype

The prototype property

Using the prototype's methods and properties

Augmenting built-in objects

Summary

Exercises

Inheritance

Prototype chaining

Inheriting the prototype only

Uber – access to the parent from a child object

Isolating the inheritance part into a function

Copying properties

Heads-up when copying by reference

Objects inherit from objects

Deep copy

object()

Using a mix of prototypal inheritance and copying properties

Multiple inheritance

Parasitic inheritance

Borrowing a constructor

Summary

Case study – drawing shapes

Exercises

The Browser Environment

Including JavaScript in an HTML page

BOM and DOM – an overview

BOM

DOM

Events

XMLHttpRequest

Summary

Exercises

Coding and Design Patterns

Coding patterns

Design patterns

Summary

Reserved Words

Reserved Words

Reserved Words

Reserved Words

Built-in Functions

Built-in Objects

Built-in Objects

Built-in Objects

Built-in Objects

Built-in Objects

Built-in Objects

Built-in Objects

Built-in Objects

Built-in Objects

Built-in Objects

Built-in Objects

Built-in Objects

Regular Expressions

Index