Book description
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.
- Learn to think in JavaScript, the language of the web browser
- Object-oriented programming made accessible and understandable to web developers
- Do it yourself: experiment with examples that can be used in your own scripts
- Write better, more maintainable JavaScript code
In Detail
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
-
Object-Oriented JavaScript
- Table of Contents
- Object-Oriented JavaScript
- Credits
- About the Author
- About the Reviewers
- Preface
- 1. Introduction
- 2. Primitive Data Types, Arrays, Loops, and Conditions
- 3. Functions
-
4. Objects
-
From Arrays to Objects
- Elements, Properties, Methods
- Hashes, Associative Arrays
- Accessing Object's Properties
- Calling an Object's Methods
- Altering Properties/Methods
- Using this Value
- Constructor Functions
- The Global Object
- constructor Property
- instanceof Operator
- Functions that Return Objects
- Passing Objects
- Comparing Objects
- Objects in the Firebug Console
- Built-in Objects
- Summary
- Exercises
-
From Arrays to Objects
- 5. Prototype
-
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
- 7. The Browser Environment
- 8. Coding and Design Patterns
- A. Reserved Words
- B. Built-in Functions
- C. Built-in Objects
- D. Regular Expressions
- Index
Product information
- Title: Object-Oriented JavaScript
- Author(s):
- Release date: July 2008
- Publisher(s): Packt Publishing
- ISBN: 9781847194145
You might also like
book
Object-Oriented JavaScript - Second Edition
If you’ve limited or no experience with JavaScript, this book will put you on the road …
book
Rediscovering JavaScript
JavaScript is no longer to be feared or loathed - the world's most popular and ubiquitous …
book
Object-Oriented JavaScript - Third Edition
Learn everything you need to know about object-oriented JavaScript with this comprehensive guide. Enter the world …
book
JavaScript
All of JavaScript's newest features, in depth, made easy to understand. JavaScript is a rapidly changing …