Object-Oriented JavaScript

This book teaches JavaScript as an object-oriented language of immense versatility. With the coding know-how contained here you'll have a lot more power to your programmer’s elbow. For beginners or intermediates.
Preview in Mapt
Code Files

Object-Oriented JavaScript

Stoyan Stefanov

This book teaches JavaScript as an object-oriented language of immense versatility. With the coding know-how contained here you'll have a lot more power to your programmer’s elbow. For beginners or intermediates.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$2.40
RRP $23.99
Save 89%
Print + eBook
$39.99
RRP $39.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$2.40
$39.99
$29.99p/m after trial
RRP $23.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Object-Oriented JavaScript Book Cover
Object-Oriented JavaScript
$ 23.99
$ 2.40
Object-Oriented JavaScript - Third Edition Book Cover
Object-Oriented JavaScript - Third Edition
$ 35.99
$ 25.20
Buy 2 for $19.90
Save $40.08
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781847194145
Paperback356 pages

Book Description

Once listed in the "nice to have" sections of job postings, these days the knowledge of JavaScript is a deciding factor when it comes to hiring web developers. And rightly so. Where in the past we used to have the occasional few lines of JavaScript embedded in a web page, now we have advanced libraries and extensible architectures, powering the "fat-client", AJAX-type rich internet applications.

JavaScript is the language of the browser, but it's also heavily employed in many other environments: server-side programming, desktop applications, application extensions and widgets. It's a pretty good deal: you learn one language and then code all kinds of different applications. While this book has one chapter specifically dedicated to the web browser environment including DOM, events, and AJAX tutorials, the rest is applicable to all the other environments too.

This book treats JavaScript as a serious object-oriented language, showing you how to build robust, maintainable, and powerful libraries and applications. Along the way, we cover many of the recent innovations such as AJAX, JSON, and interesting design and coding patterns. After reading this book, you'll be prepared to ace your JavaScript job interview and even impress with some bits that the interviewer maybe didn't know. You should read this book if you want to be able to take your JavaScript skills to a new level of sophistication.

Table of Contents

Chapter 1: Introduction
A Bit of History
The Winds of Change
The Present
The Future
Object-Oriented Programming
OOP Summary
Setting up Your Training Environment
Using the Firebug Console
Summary
Chapter 2: Primitive Data Types, Arrays, Loops, and Conditions
Variables
Operators
Primitive Data Types
Primitive Data Types Recap
Arrays
Conditions and Loops
Comments
Summary
Exercises
Chapter 3: Functions
What is a Function?
Pre-defined Functions
Scope of Variables
Functions are Data
Closures
Summary
Exercises
Chapter 4: Objects
From Arrays to Objects
Built-in Objects
Summary
Exercises
Chapter 5: Prototype
The prototype Property
Augmenting Built-in Objects
Summary
Exercises
Chapter 6: 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
Chapter 7: The Browser Environment
Including JavaScript in an HTML Page
BOM and DOM—An Overview
BOM
DOM
Events
XMLHttpRequest
Summary
Exercises
Chapter 8: Coding and Design Patterns
Coding Patterns
Design Patterns
Summary

What You Will Learn

  • Learn to think in JavaScript, the language of the web browser
  • The basics of object-oriented programming, and how they apply to JavaScript
  • Set up and use your training environment (Firebug)
  • Master data types, operators, and flow control statements
  • Understand functions: usage patterns, variable scope, and built-in functions
  • Closures demystified
  • Create and use objects
  • Understand and use prototypes
  • Reuse code with common patterns for inheritance
  • Understand and work with the BOM (Browser Object Model)
  • The DOM (Document Object Model) – accessing, modifying, adding, and deleting nodes
  • Build responsive web pages with AJAX
  • JSON (JavaScript Object Notation)
  • Listen and respond to browser events
  • Apply design patterns to solve common problems
  • Adopt coding patterns that unleash the unique power of the language
  • Make your programs cleaner, faster, and compatible with other programs and libraries
  • Achieve missing object-oriented features in JavaScript such as private properties and methods

Authors

Table of Contents

Chapter 1: Introduction
A Bit of History
The Winds of Change
The Present
The Future
Object-Oriented Programming
OOP Summary
Setting up Your Training Environment
Using the Firebug Console
Summary
Chapter 2: Primitive Data Types, Arrays, Loops, and Conditions
Variables
Operators
Primitive Data Types
Primitive Data Types Recap
Arrays
Conditions and Loops
Comments
Summary
Exercises
Chapter 3: Functions
What is a Function?
Pre-defined Functions
Scope of Variables
Functions are Data
Closures
Summary
Exercises
Chapter 4: Objects
From Arrays to Objects
Built-in Objects
Summary
Exercises
Chapter 5: Prototype
The prototype Property
Augmenting Built-in Objects
Summary
Exercises
Chapter 6: 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
Chapter 7: The Browser Environment
Including JavaScript in an HTML Page
BOM and DOM—An Overview
BOM
DOM
Events
XMLHttpRequest
Summary
Exercises
Chapter 8: Coding and Design Patterns
Coding Patterns
Design Patterns
Summary

Book Details

ISBN 139781847194145
Paperback356 pages
Read More

Read More Reviews

Recommended for You

Responsive Web Design with HTML5 and CSS3 Book Cover
Responsive Web Design with HTML5 and CSS3
$ 23.99
$ 4.80
Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Oracle Service Bus 11g Development Cookbook Book Cover
Oracle Service Bus 11g Development Cookbook
$ 35.99
$ 25.20
SOA and WS-BPEL Book Cover
SOA and WS-BPEL
$ 29.99
$ 21.00
Drools Developer's Cookbook Book Cover
Drools Developer's Cookbook
$ 26.99
$ 18.90
jBPM Developer Guide Book Cover
jBPM Developer Guide
$ 35.99
$ 25.20