Home > Store > Open Source > Ajax & JavaScript
Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript
- By David Herman
- Published Nov 26, 2012 by Addison-Wesley Professional. Part of the Effective Software Development Series series.
- Copyright 2013
- Dimensions: 7" x 9-1/8"
- Pages: 240
- Edition: 1st
- Book
- ISBN-10: 0-321-81218-2
- ISBN-13: 978-0-321-81218-6
Register your product to gain access to bonus material or receive a coupon.
Product Author Bios
David Herman is a principal researcher at Mozilla Research. He holds a BA in computer science from Grinnell College and an MS and PhD in Computer Science from Northeastern University. David serves on Ecma TC39, the committee responsible for the standardization of JavaScript.
“It’s uncommon to have a programming language wonk who can speak in such comfortable and friendly language as David does. His walk through the syntax and semantics of JavaScript is both charming and hugely insightful; reminders of gotchas complement realistic use cases, paced at a comfortable curve. You’ll find when you finish the book that you’ve gained a strong and comprehensive sense of mastery.”
—Paul Irish, developer advocate, Google Chrome
“This is not a book for those looking for shortcuts; rather it is hard-won experience distilled into a guided tour. It’s one of the few books on JS that I’ll recommend without hesitation.”
—Alex Russell, TC39 member, software engineer, Google
In order to truly master JavaScript, you need to learn how to work effectively with the language’s flexible, expressive features and how to avoid its pitfalls. No matter how long you’ve been writing JavaScript code, Effective JavaScript will help deepen your understanding of this powerful language, so you can build more predictable, reliable, and maintainable programs.
Author David Herman, with his years of experience on Ecma’s JavaScript standardization committee, illuminates the language’s inner workings as never before—helping you take full advantage of JavaScript’s expressiveness. Reflecting the latest versions of the JavaScript standard, the book offers well-proven techniques and best practices you’ll rely on for years to come.
Effective JavaScript is organized around 68 proven approaches for writing better JavaScript, backed by concrete examples. You’ll learn how to choose the right programming style for each project, manage unanticipated problems, and work more successfully with every facet of JavaScript programming from data structures to concurrency. Key features include
- Better ways to use prototype-based object-oriented programming
- Subtleties and solutions for working with arrays and dictionary objects
- Precise and practical explanations of JavaScript’s functions and variable scoping semantics
- Useful JavaScript programming patterns and idioms, such as options objects and method chaining
- In-depth guidance on using JavaScript’s unique “run-to-completion” approach to concurrency
Author's Site
Please visit the author site from Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript here.
|
13 of 13 people found the following review helpful
By James Morrin (Brockton, ma United States) - See all my reviews
Amazon Verified Purchase(What's this?)
This review is from: Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript (Effective Software Development Series) (Kindle Edition)
TL;DR If you know other languages and want to get into JavaScript this is a great start!!!People ask me how to get started with JavaScript all the time. If they are asking for a book they should get I always recommend JavaScript the Good Parts. Although they might not understand all the concepts in the book the first read. They will get a good idea of what not to do :) Then for a more definitive guide, I recommend JavaScript the Definitive guide, which is HUGE and I couldn't imagining reading the whole thing but its a great reference! This book kinda hits the sweet spot right in the middle. Just enough information to get someone comfortable in another language up and running with JavaScript.
10 of 10 people found the following review helpful
By
This review is from: Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript (Effective Software Development Series) (Paperback)
This is hands down the best JavaScript book I have read. It talks about all the expected subjects for a JS book: prototypes, concurrency with asynchronous functions, operators, functions, etc. However, it combines brevity with deep insight. I wish more technical books were this clear and concise.
6 of 6 people found the following review helpful
By
Amazon Verified Purchase(What's this?)
This review is from: Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript (Effective Software Development Series) (Paperback)
I'm a designer turned front-end developer. I came to this book from Cody Lindley's "JavaScript Enlightenment." These two books in that order should be required reading for all designers picking up JavaScript. Skip "The Good Parts" and "Eloquent" and go straight for these meaty, easy to understand volumes.This is like the big brother of JavaScript Enlightenment. It introduces intermediate to advanced concepts. It's a concise volume with small code examples you can easily follow. Some of the concepts you may not get right away, but each chapter of the book will start simple, offer you something you didn't know about JavaScript, and stretch your understanding a little bit more. You might need to read it twice, but take your time. Like a ballerina doing her stretches at the bar, you might not feel like you're getting anywhere fast, but you're doing your career a world of good with each stretch you take. |
› See all 16 customer reviews...
Online Sample Chapter
Accustoming Yourself to JavaScript
Sample Pages
Download the sample pages (includes Chapter 1 and Index)
Table of Contents
Foreword xiii
Preface xv
Acknowledgments xvii
About the Author xix
Chapter 1: Accustoming Yourself to JavaScript 1
Item 1: Know Which JavaScript You Are Using 1
Item 2: Understand JavaScript’s Floating-Point Numbers 7
Item 3: Beware of Implicit Coercions 9
Item 4: Prefer Primitives to Object Wrappers 15
Item 5: Avoid using == with Mixed Types 16
Item 6: Learn the Limits of Semicolon Insertion 19
Item 7: Think of Strings As Sequences of 16-Bit Code Units 25
Chapter 2: Variable Scope 31
Item 8: Minimize Use of the Global Object 31
Item 9: Always Declare Local Variables 34
Item 10: Avoid with 35
Item 11: Get Comfortable with Closures 39
Item 12: Understand Variable Hoisting 42
Item 13: Use Immediately Invoked Function Expressions to Create Local Scopes 44
Item 14: Beware of Unportable Scoping of Named Function Expressions 47
Item 15: Beware of Unportable Scoping of Block-Local Function Declarations 50
Item 16: Avoid Creating Local Variables with eval 52
Item 17: Prefer Indirect eval to Direct eval 54
Chapter 3: Working with Functions 57
Item 18: Understand the Difference between Function, Method, and Constructor Calls 57
Item 19: Get Comfortable Using Higher-Order Functions 60
Item 20: Use call to Call Methods with a Custom Receiver 63
Item 21: Use apply to Call Functions with Different Numbers of Arguments 65
Item 22: Use arguments to Create Variadic Functions 67
Item 23: Never Modify the arguments Object 68
Item 24: Use a Variable to Save a Reference to arguments 70
Item 25: Use bind to Extract Methods with a Fixed Receiver 72
Item 26: Use bind to Curry Functions 74
Item 27: Prefer Closures to Strings for Encapsulating Code 75
Item 28: Avoid Relying on the toString Method of Functions 77
Item 29: Avoid Nonstandard Stack Inspection Properties 79
Chapter 4: Objects and Prototypes 83
Item 30: Understand the Difference between prototype, getPrototypeOf, and__proto__ 83
Item 31: Prefer Object.getPrototypeOf to __proto__ 87
Item 32: Never Modify __proto__ 88
Item 33: Make Your Constructors new-Agnostic 89
Item 34: Store Methods on Prototypes 92
Item 35: Use Closures to Store Private Data 94
Item 36: Store Instance State Only on Instance Objects 95
Item 37: Recognize the Implicit Binding of this 98
Item 38: Call Superclass Constructors from Subclass Constructors 101
Item 39: Never Reuse Superclass Property Names 105
Item 40: Avoid Inheriting from Standard Classes 106
Item 41: Treat Prototypes As an Implementation Detail 109
Item 42: Avoid Reckless Monkey-Patching 110
Chapter 5: Arrays and Dictionaries 113
Item 43: Build Lightweight Dictionaries from Direct Instances of Object 113
Item 44: Use null Prototypes to Prevent Prototype Pollution 116
Item 45: Use hasOwnProperty to Protect Against Prototype Pollution 118
Item 46: Prefer Arrays to Dictionaries for Ordered Collections 123
Item 47: Never Add Enumerable Properties to Object.prototype 125
Item 48: Avoid Modifying an Object during Enumeration 127
Item 49: Prefer for Loops to for...in Loops for Array Iteration 132
Item 50: Prefer Iteration Methods to Loops 133
Item 51: Reuse Generic Array Methods on Array-Like Objects 138
Item 52: Prefer Array Literals to the Array Constructor 140
Chapter 6: Library and API Design 143
Item 53: Maintain Consistent Conventions 143
Item 54: Treat undefined As “No Value” 144
Item 55: Accept Options Objects for Keyword Arguments 149
Item 56: Avoid Unnecessary State 153
Item 57: Use Structural Typing for Flexible Interfaces 156
Item 58: Distinguish between Array and Array-Like 160
Item 59: Avoid Excessive Coercion 164
Item 60: Support Method Chaining 167
Chapter 7: Concurrency 171
Item 61: Don’t Block the Event Queue on I/O 172
Item 62: Use Nested or Named Callbacks for Asynchronous Sequencing 175
Item 63: Be Aware of Dropped Errors 179
Item 64: Use Recursion for Asynchronous Loops 183
Item 65: Don’t Block the Event Queue on Computation 186
Item 66: Use a Counter to Perform Concurrent Operations 190
Item 67: Never Call Asynchronous Callbacks Synchronously 194
Item 68: Use Promises for Cleaner Asynchronous Logic 197
Index 201

This book includes free shipping!
This book includes free shipping!
eBook (Watermarked)
$31.99
$25.59
Includes EPUB, MOBI, and PDF
About eBook Formats
This eBook includes the following formats, accessible from your Account page after purchase:
EPUBThe open industry format known for its reflowable content and usability on supported mobile devices.
MOBIThe eBook format compatible with the Amazon Kindle and Amazon Kindle applications.
PDFThe popular standard, used most often with the free Adobe® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discretely watermarking it with your name, making it uniquely yours.
- Request an Instructor or Media review copy.
- Corporate, Academic, and Employee Purchases
- International Buying Options
Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.

