6 Rules To Master JavaScript's "this"
6 Rules To Master JavaScript's "this" (The Book + The Screencast)
$15.00
Minimum price
$19.00
Suggested price
6 Rules To Master JavaScript's "this"

This book is 100% complete

Completed on 2015-08-31

About the Book

Wondering why JavaScript’s “this” is pointing to that, when you thought it was pointing over there? Confused by the seemingly arbitrary value of “this” … if it even has a value?

You’re not alone.

JavaScript’s context variable is one of the most frustrating and confusing bits of important information that you need to understand. But don’t worry – the rules for managing “this” are easier to understand than most people think. It only takes a little knowledge, a few examples to work with, and a willingness to travel the path. 

The name says it all: 5 Rules For Mastering JavaScript’s “this”. This book is split up in to multiple "days" - a short chapter each day, designed to guide you down the path of mastering "this". Every day, for 5 days, read the next chapter.  

Start The Journey

You’ll start with “Day 0″ an introduction that shows you the map that you’ll be following. From there, Day 1 starts you out on what may be the most difficult leg of the journey. If you can get past Day 1, the rest of the journey will be smooth sailing!

Along the way, you’ll learn lessons through examples and demonstrations of code that illustrate the rules and patterns for managing “this”. But beware – this isn’t a course that will give you all of the answers and demonstrations in a JSBin or JSFiddle. While you will see plenty of code samples, I have purposely left it up to you to run the code so that you can see what happens, first-hand. Work through the examples, study the text and put your knowledge to work in your applications. Taking a hands-on approach to learning "this" will equip you with the skills you need.

Want This Book's Content, Free?

No problem! I've got a free 5 day email course that covers all of the material in this book. Just head over to the email course page and sign up on there. You'll get the same material, delivered to you one day at a time.  You'll also get the benefit of being signed up for my standard mailing list at the same time, where I provide weekly summaries of my blog posts and tips / lessons learned / career advice, based on reader questions!

About the Author

Derick Bailey
Derick Bailey

Derick Bailey is an entrepreneur and software developer in central Texas He's been slinging code since the late 80’s and doing it professionally since the mid 90's. These days, He blogs at DerickBailey.com, produces screencasts at WatchMeCode.net and tweets as @derickbailey.

Packages

The Book + The Screencast

Master the material with the screencast and the ebook!

  • English

  • PDF

  • EPUB

  • MOBI

  • APP

$15.00
Minimum price
$19.00
Suggested price
The Book
  • English

  • PDF

  • EPUB

  • MOBI

  • APP

$9.00
Minimum price
$15.00
Suggested price

Table of Contents

  • About This Book
    • How This Book Is Laid Out
  • Day 0: Preparing For The Journey
    • The 5 Rules Of JavaScript’s “this”
    • The Real Journey Begins Tomorrow
  • Day 1: Simple Function Invocation
    • Simple Function Invocation
    • The Default Value of “this”
    • In Review
  • Day 2: Method Calls On Objects
    • An Object With A Method
    • Dissecting The Rule
    • When A Method Becomes A Function
    • In Summary
  • Day 3: The “new” Keyword
    • A Constructor Function
    • How Does That Work?
    • In Summary
  • Day 4: Using .call And .apply
    • Functions With Methods
    • Similar, But Different
    • Override Invocation Patterns
    • Coming Up Tomorrow
  • Day 5: Using .bind
    • Introducing The .bind Method
    • Permanently Override The Context
    • A Note On The Availability Of .bind
    • Summary
    • What About ES6? I heard …
  • Day 6: ES6 (Arrow) ⇒ { Functions }
    • ES6 Arrow Functions
    • Lexical Scope
    • Changing The Surrounding “this” Changes The Arrow Function’s
    • Worth 10x It’s Weight In Deleted Code
    • An Epic Journey
    • … And One More Thing
  • Bonus!
    • Partial Function Application
    • self = this;
  • Thank You
  • About Derick

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Write and Publish on Leanpub

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub