Book description
If you’ve limited or no experience with JavaScript, this book will put you on the road to being an expert. A wonderfully compiled introduction to objects in JavaScript, it teaches through examples and practical play.
- Think in JavaScript
- Make object-oriented programming accessible and understandable to web developers
- Apply design patterns to solve JavaScript coding problems
- Learn coding patterns that unleash the unique power of the language
- Write better and more maintainable JavaScript code
- Type in and play around with examples that can be used in your own scripts
In Detail
JavaScript is the behavior, the third pillar in today's paradigm that looks at web pages as something that consists of clearly distinguishable parts: content (HTML), presentation (CSS) and behavior (JavaScript). Using JavaScript, you can create not only web pages but also desktop widgets, browser and application extensions, and other pieces of software. It's a pretty good deal: you learn one language and then code all kinds of different applications. While there's one chapter specifically dedicated to the web browser environment including DOM, Events and AJAX tutorials, the rest is applicable to the other environments
Many web developers have tried coding or adopting some bits of JavaScript, but it is time to ""man up"" and learn the language properly because it is the language of the browser and is, virtually, everywhere. This book starts from zero, not assuming any prior JavaScript programming knowledge and takes you through all the in-depth and exciting futures hidden behind the facade.
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. 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 - Second Edition
- Table of Contents
- Object-Oriented JavaScript - Second Edition
- Credits
- About the Authors
- About the Reviewer
- www.PacktPub.com
- Preface
- 1. Object-oriented JavaScript
- 2. Primitive Data Types, Arrays, Loops, and Conditions
- 3. Functions
-
4. Objects
-
From arrays to objects
- Elements, properties, methods, and members
- Hashes and associative arrays
- Accessing an object's properties
- Calling an object's methods
- Altering properties/methods
- Using the this value
- Constructor functions
- The global object
- The constructor property
- The instanceof operator
- Functions that return objects
- Passing objects
- Comparing objects
- Objects in the WebKit 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
- Including JavaScript in an HTML page
- BOM and DOM – an overview
-
BOM
- The window object revisited
- window.navigator
- Your console is a cheat sheet
- window.location
- window.history
- window.frames
- window.screen
- window.open()/close()
- window.moveTo() and window.resizeTo()
- window.alert(), window.prompt(), and window.confirm()
- window.setTimeout() and window.setInterval()
- window.document
- DOM
- Events
- XMLHttpRequest
- Summary
- Exercises
- 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 - Second Edition
- Author(s):
- Release date: July 2013
- Publisher(s): Packt Publishing
- ISBN: 9781849693127
You might also like
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 : Object-Oriented Programming
Build sophisticated web applications by mastering the art of Object-Oriented Javascript About This Book Learn popular …
book
Mastering JavaScript Object-Oriented Programming
Unleash the true power of JavaScript by mastering Object-Oriented programming principles and patterns About This Book …
book
Rediscovering JavaScript
JavaScript is no longer to be feared or loathed - the world's most popular and ubiquitous …