JavaScript for PHP Developers. A Concise Guide to Mastering JavaScript - Helion
ISBN: 978-14-493-7031-2
stron: 160, Format: ebook
Data wydania: 2013-04-24
Księgarnia: Helion
Cena książki: 46,74 zł (poprzednio: 59,16 zł)
Oszczędzasz: 21% (-12,42 zł)
If you want to significantly expand your web development skills beyond PHP, this practical, hands-on book teaches you ECMAScript—the core JavaScript language—from the ground up. You’ll discover some similarities between JavaScript and PHP, such as conditions and loops, but the primary focus is on JavaScript’s unique object creation, classes, prototypes, and inheritance.
JavaScript knowledge is essential for working with today’s Web, whether you’re building applications for the client, the server, or for mobile use—and your PHP experience gives you a head start. This book will help you become fluent with JavaScript quickly, and then serve as a handy reference once you start coding.
- Explore JavaScript syntax, including variables, arrays, loops, and conditions
- Learn how functions are important in JavaScript—and why they’re actually objects
- Delve into JavaScript’s object-oriented features, including prototypes, code reuse, and inheritance
- Examine the built-in API and explore its global functions, properties, and objects
- Learn about updates in ECMAScript5, the latest version of the standard
- Use common design patterns to organize your code in large applications
Osoby które kupowały "JavaScript for PHP Developers. A Concise Guide to Mastering JavaScript", wybierały także:
- React and React Native 230,00 zł, (29,90 zł -87%)
- Refactoring TypeScript 186,88 zł, (29,90 zł -84%)
- Blockchain Developer's Guide 175,88 zł, (29,90 zł -83%)
- Learn Three.js 166,11 zł, (29,90 zł -82%)
- React 17 Design Patterns and Best Practices 157,37 zł, (29,90 zł -81%)
Spis treści
JavaScript for PHP Developers. A Concise Guide to Mastering JavaScript eBook -- spis treści
- JavaScript for PHP Developers
- Acknowledgments
- Dedication
- Preface
- Conventions Used in This Book
- Using Code Examples
- Safari Books Online
- How to Contact Us
- 1. Introduction
- Scope of This Book
- The Language
- Learning Environment
- Browsers
- JavaScriptCore
- Node.js and Rhino
- Longer Examples
- Lets Get Started
- 2. 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
- Variables
- 3. 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
- 4. Object-Oriented Programming
- Constructors and Classes
- Returning Objects
- 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
- Constructors and Classes
- 5. The Built-In API
- The Global Object
- Global Properties
- Global Functions
- Numbers
- Encoding URLs
- Built-In Constructors
- Object
- toString()
- toLocaleString()
- valueOf()
- hasOwnProperty()
- propertyIsEnumerable()
- isPrototypeOf()
- constructor
- Array
- length
- push()
- pop()
- unshift()
- shift()
- concat()
- sort()
- slice()
- splice()
- reverse()
- join()
- RegExp
- test() and properties
- exec()
- Function
- Function properties
- String
- substring()
- localeCompare()
- split()
- search()
- replace()
- match()
- Number
- Boolean
- Math
- Error
- Date
- Object
- Constructors Review
- 6. ECMAScript 5
- Strict Mode
- Property Attributes
- New Object APIs
- Object.create()
- Object.getOwnPropertyDescriptor()
- Object.defineProperty() and Object.defineProperties()
- 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
- 7. JavaScript Patterns
- Private Properties
- Private Methods
- Exposing Private Objects
- Returning Private Arrays
- Deep Copy via JSON
- Revealing Pattern
- Constants
- Namespaces
- Modules
- CommonJS Modules
- Defining a CommonJS Module
- Using a CommonJS Module
- Using an Agnostic Module
- AMD
- Design Patterns
- Singleton
- Singletons with constructors
- Factory
- Decorator
- Decoration API
- Adding decorators
- decorate() and get()
- Singleton
- Documentation and Testing
- Manual
- Documenting Your Code
- Unit Testing
- JSLint
- Linting This Book
- Private Properties
- Index
- About the Author
- Colophon
- Copyright