You Don't Know JS: this & Object Prototypes
Publisher: O'Reilly Media
Final Release Date: July 2014
Pages: 174

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
Table of Contents
Product Details
About the Author
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyYou Don't Know JS: this & Object Prototypes
 
4.9

(based on 8 reviews)

Ratings Distribution

  • 5 Stars

     

    (7)

  • 4 Stars

     

    (1)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (0)

100%

of respondents would recommend this to a friend.

Pros

  • Well-written (6)
  • Concise (5)
  • Helpful examples (5)
  • Accurate (4)
  • Easy to understand (4)

Cons

    Best Uses

    • Intermediate (8)
    • Expert (3)
      • Reviewer Profile:
      • Developer (7)

    Reviewed by 8 customers

    Sort by

    Displaying reviews 1-8

    Back to top

    (1 of 1 customers found this review helpful)

     
    4.0

    well to fill gaps

    By Laurent

    from Bordeaux

    About Me Developer

    Verified Buyer

    Pros

    • Easy to understand
    • Well-written

    Cons

      Best Uses

      • Intermediate

      Comments about oreilly You Don't Know JS: this & Object Prototypes:

      With this book, I have learned two things that I didn't understand in Js :
      - heritage whith prototype
      - this keyword

       
      5.0

      totally worth ur time and money

      By mihneasim

      from EU

      About Me Developer

      Verified Buyer

      Pros

      • Easy to understand
      • Helpful examples

      Cons

        Best Uses

        • Intermediate
        • Novice
        • Student

        Comments about oreilly You Don't Know JS: this & Object Prototypes:

        I like his explanations. Suitable for any js apprentice.

         
        5.0

        Excellent coverage of a complex topic

        By Matthew

        from Des Moines, IA

        Verified Reviewer

        Pros

        • Concise
        • Helpful examples
        • Well-written

        Cons

        • Difficult to understand

        Best Uses

        • Expert
        • Intermediate

        Comments about oreilly You Don't Know JS: this & Object Prototypes:

        Kyle Simpson explains the semantics of using "this" in Javascript and why it is not the same as Java. The Javascript keyword "this" is often misunderstood. Many works treat it as the Javascript equivalent of Java's "this" or Python's "self," and while that understanding will lead to working programs in most cases, Simpson explains where that conception will break down in a way that many programmers will not be able to anticipate. He later discusses Javascript's prototypal inheritance and how it works different than typical inheritance designs.

        This text should not be a first introduction to the language and maybe not even a second or third. The topics covered are quite advanced and require a relatively high familiarity with Javascript to begin to understand. At times the text can be very confusing and require re-reading sections to fully grasp, however this is due to the complexity of the material covered and not due the author. The author's writing style is quite clear and his examples are well explained. Code samples are very short and to the point, not wasting space with unnecessary filler code which so many technical books do (pages of GUI code for explaining a simple input/output example for instance).

        This is the first example I have seen of covering these topics in this manner, and while at first I was unsure if they really warranted their own book, I did not realize how poorly I understood the semantics of "this." I would highly recommend the text to anybody who expects to do much work in Javascript, in particular in creating or working with frameworks, where a full knowledge of the topics covered could prove indispensible. After reading this text, I would be interested in reading the other texts in the series as well.

        (I received an electronic copy of the book as part of OReilly's reader review program.)

        (0 of 1 customers found this review helpful)

         
        5.0

        Essential reading

        By Tom Dan

        from Ca

        About Me Developer

        Verified Buyer

        Pros

        • Accurate
        • Concise
        • Helpful examples
        • Well-written

        Cons

          Best Uses

          • Expert
          • Intermediate

          Comments about oreilly You Don't Know JS: this & Object Prototypes:

          Great book, highly recommended.

          (2 of 2 customers found this review helpful)

           
          5.0

          great explanation

          By Lewis

          from Berkeley, CA

          About Me Developer

          Verified Buyer

          Pros

          • Concise
          • Helpful examples

          Cons

          • Combative Tone

          Best Uses

          • Intermediate

          Comments about oreilly You Don't Know JS: this & Object Prototypes:

          I was pretty ignorant of inheritance and how 'this' works. This book got me up to speed, and now I'm using call, apply, etc in my code. The book has this idea called OLOO that I've found pretty useful, too.

          (1 of 2 customers found this review helpful)

           
          5.0

          Great Series Of Books

          By Don

          from Florida

          About Me Designer, Developer

          Verified Buyer

          Pros

          • Accurate
          • Concise
          • Well-written

          Cons

            Best Uses

            • Expert
            • Intermediate

            Comments about oreilly You Don't Know JS: this & Object Prototypes:

            This is the second in the series of "You Don't Know Js:". If you are interested in really knowing how JavaScript works, these books are for you.

            (1 of 1 customers found this review helpful)

             
            5.0

            First class explanations

            By Pedro The Learning Machine

            from Pleasanton, CA

            About Me Designer, Developer, Educator

            Verified Reviewer

            Pros

            • Accurate
            • Concise
            • Easy to understand
            • Helpful examples
            • Immediately Applicable
            • Well-written

            Cons

              Best Uses

              • Intermediate
              • Novice
              • Student

              Comments about oreilly You Don't Know JS: this & Object Prototypes:

              The mysteries of Javascript's "this" explained for your grokking pleasure.
              Also included are the new details in ECMA6 as they pertain to objects and their use.
              If you're looking for a book that finally explains "this" and objects so that by the end you have no doubt in your mind about how these concepts operate in Javascript, read this and move on with your life.

              (3 of 4 customers found this review helpful)

               
              5.0

              Clears It All Up For Me

              By Rob Simpson

              from Warrenton, VA

              About Me Developer

              Pros

              • Accurate
              • Easy to understand
              • Well-written

              Cons

                Best Uses

                • Intermediate

                Comments about oreilly You Don't Know JS: this & Object Prototypes:

                Just as the first book did, this one made it very clear and easy to understand this and prototype. I enjoyed the read and how straight forward it was in helping to understand how and when to use. Great read

                Displaying reviews 1-8

                Back to top

                 
                Buy 2 Get 1 Free Free Shipping Guarantee
                Buying Options
                Immediate Access - Go Digital what's this?
                Ebook: $21.99
                Formats:  DAISY, ePub, Mobi, PDF
                Print & Ebook: $27.49
                Print: $24.99