Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Kyle Simpson

Rating No ratings yet

No matter how much experience you have with javascript, odds are you don’t fully understand the language. This concise, in-depth guide takes you inside javascript’s this structure and object prototypes. You’ll learn how they work and why they’re integral to behavior delegation—a design pattern in which objects are linked, rather than cloned. Like other books in the “You Don’t Know JS” series, this and Object Prototypes dives into trickier parts of the language that many javascript programmers simply avoid. Armed with this knowledge, you can become a true javascript master. With this book you will: Explore how the this binding points to objects based on how the function is called Look into the nature of JS objects and why you’d need to point to them Learn how developers use the mixin pattern to fake classes in JS Examine how JS’s prototype mechanism forms links between objects Learn how to move from class/inheritance design to behavior delegation Understand how the OLOO (objects-linked-to-other-objects) coding style naturally implements behavior delegation

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

Brief outline
【One-Line Pitch】 No matter how much experience you have with javascript, odds are you don’t fully understand the language. This concis… 【Book Arc】 - **Opening (~0%–12%)**: This concise, in-depth guide takes you inside javascript’s this structure and object prototypes.; they work and why they’re integral to behavior delegation— a design pattern in which objects are linked, rather than cloned. - **Early (~12%–35%)**: Furthermore, we eschew the common advice to retreat when the road gets rough.; urn context.name.toUpperCase(); - **Middle (~35%–65%)**: insulates our pro‐ gram’s global object from side effects.; s binding (whatever it is) from its enclosing function call. - **Late (~65%–88%)**: x (or seven, depending on your perspective) primitive types.; types of vehicles (the “planes, trains, and automobiles”). - **Ending (~88%–100%)**: // create an object linked to anotherObject var myObject Object.create( anotherObject );; ccurs, and thus these objects don’t end up totally separate and disconnected from each other, but rather, quite linked. 【Key Takeaways】 - **This concise** (Opening): This concise, in-depth guide takes you inside javascript’s this structure and object prototypes. - **they work and why they…** (Opening): they work and why they’re integral to behavior delegation— a design pattern in which objects are linked, rather than cloned. - **nguage that I needed t…** (Opening): nguage that I needed to pay closer attention to. - **Furthermore** (Early): Furthermore, we eschew the common advice to retreat when the road gets rough. - **urn context.name.toUpp…** (Early): urn context.name.toUpperCase(); - **// 4 Instead of avoidi…** (Early): // 4 Instead of avoiding this, we embrace it. 【Reading Tips】 - Use Passage locations below to jump into the text and set reading anchors - Chinese and English guides are each generated once, then served from local cache without calling the model again 【Coverage Limits】 Compressed outline without the model (~32 index chunks). Full structured guide needs AI available.
Page 1
they work and why they’re integral to behavior delegation— a design pattern in which objects are linked, rather than cloned. Like other books in the You Don’...
View in text
Page 13
oks Online offers a range of product mixes and pricing pro‐ grams for organizations, government agencies, and individuals. Sub‐ scribers have access to thous...
View in text
Excerpt 3
find the call-site and inspect it to see which rule applies. But, what if the call-site has multiple eligible rules? There must be an order of precedence to...
View in text
Excerpt 4
rance. The engine stores values in implementation-dependent ways, and may very well not store them in some object container. What is stored in the container...
View in text
Excerpt 5
property enumerable: true } myObject.a; // 2 54 | Chapter 3: Objects It appears that the in operator will check for the existence of a value inside a contain...
View in text
Excerpt 6
fully an essentially perfect copy. And then the builder can move to the open lot next door and do it all over again, creating yet another copy. The relations...
View in text
Excerpt 7
{ a: 2 // create an object linked to `anotherObject` var myObject = Object.create( anotherObject ); myObject.a; // 2 We will explain what Object.create(..) d...
View in text
Excerpt 8
ct by default (at declaration-time on line 1 of the snippet!) gets a public, nonenumerable (see Chapter 3) property called .constructor, and this property is...
View in text
Tags
AI categories
JavaScript
ISBN: 1491904151
Publisher: O'Reilly Media
Publish Year: 2014
Language: English
Pages: 174
File Format: PDF
File Size: 3.0 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…