Lesson Description

The "Wrapping up" Lesson is part of the full, JavaScript: The Hard Parts, v3 course featured in this preview video. Here's what you'd learn in this lesson:

Will wraps up the course by summarizing higher-order functions, closure, type coercion, asynchronous code execution, and OOP. He encourages understanding these fundamentals to become autonomous engineers and better use frameworks and other languages.

Preview

Transcript from the "Wrapping up" Lesson

[00:00:00]
>> Will Sentance: That's it. So people, that is it. That is the hard parts of JavaScript. We covered the underlying principles, which I think we would love to go back to, right? We had a memory, we had a thread, and we had the call stack, the three core parts of JavaScript. We then covered higher-order functions, the ability for us to call functions, but leave some of their work, TBD until we actually executed them.

[00:00:25]
Leave it blank. Much like we'd use a function's parameters to insert data later, we could also insert some of the functionality later. Gave us access to map, to filter, reduce, all without mutating, without changing our input data, no side effects to our functions. We then discovered that higher-order functions also include returning out a function from where it was defined, and bringing with it the backpack, exactly, slash closure, slash persistent lexical scope reference data.

[00:00:57]
That meant that our functions could actually be treated a lot like our OOP approach. Our functions would have persistent data bundled on them, pretty powerful, allowed us to create functions like once, limiting functions from running again and again, allowed us to think about iterators and generators. I encourage you to go and watch the functional programming hard parts for that. We then, what do we do next?

[00:01:19]
Ah, we dealt with type coercion and discovered a new type of data in JavaScript called the symbol that allowed us to create hidden properties, hidden labels on objects, ones that we could then use to take advantage of JavaScript's type coercion built-in feature and set the behavior we wanted to have happen when we tried to coerce, change an object into a number, and manually take control of it. Pretty nice, without breaking historic code, because JavaScript introduced us a brand new type of label we could have, a symbol.

[00:01:53]
We then hit the backbone of modern web development, asynchronicity, and we added the callback queue task queue, the microtask queue, our web browser features, our event loop, our promises, all that allowed us to set up work that would take a long time off on the internet, for example, before it comes back, but without blocking our single JavaScript thread. And when it did come back, we had lots of rules for how it got back into JavaScript, remember that, long ago, with our beautiful colorful whiteboard, colorable blackboard, and then finally, we finished with implementing as close as we could the object-oriented paradigm that came down to only one thing, keep our data and the associated code we wanted to run on it, bundled up in an object.

[00:02:44]
But to produce those, we had to do a bunch of work, so we automated a lot of that work with the beautiful new keyword. But in doing so, we also said, hold on, can we implement a bunch of other traditional object-oriented programming features, like private fields, like static fields, these sorts of instance specific fields that allow us to truly emulate as much of the object-oriented style as possible.

[00:03:15]
So that is it, people. I hope that all of this you can carry forward in your work in hopefully the years to come. You can therefore guide others on how this programming language, JavaScript is working under the hood when you use the frameworks, now things start to slot into place as you realize what they're really doing, and even as you move to other languages, you realize that if you can break out how the composing pieces work, you can truly become autonomous as an engineer, and take on all the hardest challenges.

[00:03:45]
So, thank you everybody. That is it. Thank you to our wonderful online audience, to all of you for answering every question, talking through the code line by line for two days. Well, thank you to our wonderful team who have kept it all up through that time as well, even harder for them because at least I'm up here. But thank you everybody, that is it, over and out.

Learn Straight from the Experts Who Shape the Modern Web

  • 250+
    In-depth Courses
  • Industry Leading Experts
  • 24
    Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now