Skip to content

JavaScript for PHP Developers

Spend $50 to get a free DVD!

ISBN-10: 1449320198

ISBN-13: 9781449320195

Edition: 2012

Authors: Stoyan Stefanov

List price: $15.99
Blue ribbon 30 day, 100% satisfaction guarantee!
what's this?
Rush Rewards U
Members Receive:
Carrot Coin icon
XP icon
You have reached 400 XP and carrot coins. That is the daily max!

Description:

Ready to expand your PHP web development skills with JavaScript? With this guide, you can leverage your experience with PHP to pick up JavaScript quickly. Both languages share the C language syntax, enabling you to skip similarities such as conditions and loops to focus on JavaScript’s unique object creation, classes, prototypes, and inheritance.PHP is a valuable web development tool on its own, but with the increase in client-side development, knowledge of JavaScript has become essential for working with today’s Web. By concentrating on the differences between these languages, this book helps PHP programmers, web architects, and back-end and front-end engineers get up to speed on…    
Customers also bought

Book details

List price: $15.99
Copyright year: 2012
Publisher: O'Reilly Media, Incorporated
Publication date: 5/12/2013
Binding: Paperback
Pages: 160
Size: 7.00" wide x 9.25" long x 0.50" tall
Weight: 0.638
Language: English

Stoyan Stefanov is a Yahoo! web developer, Zend Certified Engineer, and an author, contributor, and tech reviewer of various O'Reilly books. He speaks regularly about web development topics at conferences and on his blog at www.phpied.com. Stoyan is the creator of the smush.it image optimization tool and architect of Yahoo's performance optimization tool YSlow 2.0.

Acknowledgments
Preface
Introduction
Scope of This Book
The Language
Learning Environment
Browsers
JavaScriptCore
Node.js and Rhino
Longer Examples
Lets Get Started
JavaScript Syntax
Variables
What Does $ Do in JavaScript?
Values
typeof Introspection
null and undefined
Arrays
Associative Arrays
Conditions
Ternary Operator
Strict Comparison
switch
try-catch
while and for Loops
for-in Loops
Miscellaneous Operators
in
String Concatenation
Type Casting
void
Comma Operator
Functions
Default Parameters
Any Number of Arguments
arguments.length Trick
Return Values
Functions Are Objects
A Different Syntax
Scope
Hoisting
Hoisting Functions
Closures
Closures in PHP
Scope Chain
The Scope Chain in the WebKit Console
Retaining the Scope
Retaining References, Not Values
Closures in a Loop
Exercise: onclick Loop
Immediate Functions
Initialization
Privacy
Passing and Returning Functions
Callbacks Are Not Strings
Object-Oriented Programming
Constructors and Classes
Returning Objects
More on This
Enforcing Constructors
Prototypes
Object Literals
Accessing Properties
Confusing Dots
Methods in Object Literals
Fancy Arrays
Own Properties
_proto_
this or prototype
Inheritance
Inheritance via the Prototype
Inheritance via Copying Properties
Beget Object
"Classical" extend()
Borrowing Methods
Conclusion
The Built-In API
The Global Object
Global Properties
Global Functions
Numbers
Encoding URLs
Built-In Constructors
Object
Array
RegExp
Function
String
Number
Boolean
Math
Error
Date
Constructors Review
ECMAScript5
Strict Mode
Property Attributes
New Object APIs
Object.create()
ObjectgetOwnPropertyDescriptor()
Object.defineProperty() and Object.defmeProperties()
Restricting Object Mutations
Looping Alternatives
Object.getPrototypeOf()
Array Additions
Array.isArray()
indexOf() and lastIndexOf()
Walking the Array Elements
Filtering
Testing the Array Content
Map/Reduce
String Trimming
New in Date
Function.prototype.bind()
JSON
Shims
JavaScript Patterns
Private Properties
Private Methods
Exposing Private Objects
Returning Private Arrays
Deep Copy via JSON
Revealing Pattern
Constants
Namespaces
Modules
Common JS Modules
Defining a CommonJS Module
Using a CommonJS Module
Using an Agnostic Module
AMD
Design Patterns
Singleton
Factory
Decorator
Documentation and Testing
Manual
Documenting Your Code
Unit Testing
JSLint
Linting This Book
Index