Frontendmasters – JavaScript – The Hard Parts, v2
English | Size: 4.74 GB
Category: Tutorial
Go under the hood of some of the most important aspects of javascript! You’ll learn what you need to know to become a sought-after, versatile, problem-solving developer. Combining mental models of javascript’s inner workings and hands-on programming challenges, this course will give you a solid understanding of callbacks and higher-order functions, closure, asynchronous javascript, and object-oriented javascript! This course is for developers with a basic to intermediate knowledge of javascript who wants to deepen their understanding of the fundamentals to the next level.
This course and others like it are available as part of our Frontend Masters video subscription.
Published: January 7, 2020
Table of Contents
Introduction
00:00:00 – 00:03:40
Introduction
Will Sentance introduces the agenda for the course, defines the purpose of the course that differs for mid level and senior level engineers, then explains how this version of the course is an improvement to version one.
javascript Principles
00:03:41 – 00:08:24
Thread of Execution
Will reviews how javascript traverses code with an example while using precise language.
00:08:25 – 00:16:12
Functions
Will reviews how functions scope the thread of execution and memory.
00:16:13 – 00:20:46
Call Stack
Will introduces the call stack to explain how javascript keeps track of the thread of execution.
Functions & Callbacks
00:20:47 – 00:26:02
Generalized Functions
Will uses a trivial example to demonstrate how parameters can be used to extend functionality.
00:26:03 – 00:33:45
Repeating Functionality
Will diagrams an function that uses an array as a parameter. Students are then directed to pair with a partner and verbalize the same diagram with one character changed to provide context a case where a generalized function might be useful.
00:33:46 – 00:43:09
Higher Order Functions
Will diagrams the function with one piece of functionality changed to pursue the point that this function and the previous could be restructured to accommodate both functionality cases by changing it to accept both data and instructions in the form of a function of how to manipulate the data.
00:43:10 – 00:53:15
Higher Order Functions Example
Will diagrams a proposed solution that generalizes a function to accept an argument and a function as parameters.
00:53:16 – 00:55:24
Higher Order Functions Q&A
Will answers a question from the audience about execution context within a for loop, and whether the function arguments are pass by value or pass by reference.
00:55:25 – 01:00:40
Callbacks & Higher Order Functions
Will defines which function in the previous example is the higher order function, and which is the callback. The previous material is reviewed by outlining how this pattern keeps the code DRY, readable, and is the backbone of asynchronous javascript.
01:00:41 – 01:13:14
Arrow Functions
Will diagrams how anonymous functions are used under the hood when an arrow function is instantiated. The drawbacks of using arrow functions on overall understanding and readability is then discussed, and a question is asked about whether there are memory considerations when using an arrow function is asked.
01:13:15 – 01:19:46
Pair Programming
Will explains why pair programming is the most effective way to grow as a software engineer. It’s outlined how another person helps to tackle blocks, stay focused, refine technical communication, and improve collaboration skills.
Closure
01:19:47 – 01:25:10
Closure Introduction
Will explains the many areas where closure is utilized within the javascript language, then goes on to foreshadow the next section by explaining how a function eliminates the state after it’s executed, but that it could be useful if it could keep a live cache of data.
01:25:11 – 01:40:28
Returning Functions
Will diagrams what is happening when a function returns another function, and drives home the point that by assigning a variable to the result of a function that returns a function, that it’s possible to then call the internal function by using the named variable.
01:40:29 – 01:47:21
Nested Function Scope
Will diagrams a function that is both defined and called within a function to pose the question of whether its where it’s defined or called as to what scope it has access to.
01:47:22 – 01:56:13
Retaining Function Memory
Will diagrams what is happening when a function is called outside of the function in which it was defined. This new function retains it’s original local memory from where it was created.
01:56:14 – 02:04:02
Function Closure
Will reveals the key functionality of closure that allows a function to have a permanent stored data cache. The caveats of the functionality are discussed, as well as the hidden property of [[scope]] afforded to functions.
02:04:03 – 02:10:18
Closure Q&A
Will fields questions from the audience regarding whether there can be a wrapper such that there is another execution context returning out the first closure, function decoration, and whether variables that aren’t referenced by the returned function are accessible by the backpack. Clarifications are also made on a private variables, and error handling within closure.
02:10:19 – 02:20:12
Closure Technical Definition & Review
Will discusses the concept of lexical or static scope as the key as to why closure works, and defines in technical terms what is occuring when closure is used. A clarification is also taken regarding reassigning variables with the backpack attached.
02:20:13 – 02:29:04
Multiple Closure Instances
Will diagrams what is happening when another instance of the original closure is instantiated and called. Emphasis is placed on whether the original instance of the closure affects the secondary instance.
02:29:05 – 02:36:47
Practical Applications
Will provides examples of where closure is used, including helper functions, iterators, generators, modules, and asynchronous javascript. Real use cases are discussed for clean, professional code.
02:36:48 – 02:37:40
Closure Exercises
Students are then instructed to continue pair programming with closure exercises.
Asynchronous javascript
02:37:41 – 02:44:59
Single Threaded Execution Review
Will introduces what will be covered in the next few sections, then goes on to review how javascript executes code through a single thread.
02:45:00 – 02:51:05
Asynchronicity in javascript
Will uses the previous example to explain what issues could be posed by having only a single thread of execution when calling to an API. The additional features on top of javascript that have to be introduced to explain the functionality of a setTimeOut function are defined as web browser or Node background APIs, promises, and the event loop, callback/task queue, and microtask queue.
02:51:06 – 02:58:12
Asynchronous Browser Features
Will discusses some of the key features that the browser provides. To interact with the features that the browser offers, javascript offers “facade functions” that look like javascript, but are actually part of the browser. Examples of these functions include console, fetch, document, and setTimeout.
02:58:13 – 03:06:39
Web API Example
Will diagrams what is happening when setTimeout is called, and demonstrates why it doesn’t break the rule of javascript being single-threaded.
03:06:40 – 03:11:02
Web API Rules
Will fields questions from the audience about how the function that is used by the “facade functions” keep state, and how the call stack works when asynchronicity is introduced. These questions are used to preface the point that there needs to be clearly defined rules for how this functionality works.
03:11:03 – 03:25:29
Callback Queue & Event Loop
Will defines the concept of a callback queue, then diagrams an example that demonstrates the functionality of the event loop, which ties the call stack and callback queue together.
03:25:30 – 03:27:13
Callback Queue and Event Loop Q&A
Will fields questions from the audience about what would happen if the one of the functions were to return an augmented variable, a clarification on the previous example, and what would happen if the function’s order was augmented.
03:27:14 – 03:30:28
Callback Hell & Async Exercises
Will reviews the problems and benefits of using web browser APIs with callback functions. Students are then instructed to continue pair programming with asynchronous exercises.
Promises
03:30:29 – 03:36:59
Promises Introduction
Will gives context to what javascript was like before ES6, and explains why promises are an extremely powerful feature today. The two-pronged “facade” functions that were introduced to initiate background web browser work, then return a placeholder object to javascript are introduced.
03:37:00 – 03:49:03
Promises Example: fetch
Will diagrams what is happening behind the scenes when a call to a Twitter API is made using fetch. The two pronged functionality stemming from the fetch promise is explored.
03:49:04 – 04:00:18
Promises Example: then
Will diagrams the built-in method that calls methods that depend on the returned data. The rest of the example is diagrammed in full to demonstrate how the combination of fetch and then can pull data from an external API, and halt execution of methods that depend on the data until the data is received.
04:00:19 – 04:15:53
Web APIs & Promises Example: fetch
Will diagrams a more complex example involving both web browser APIs and promises. The problem begins by instantiating functions into the global memory, then a setTimeout function is called, and a fetch call is made to a Twitter API. It’s demonstrated how each of these things end up in the context of the web browser, callback queue, or call stack.
04:15:54 – 04:22:17
Web APIs & Promises Example: then
Will continues diagramming the example involving both web browser APIs and promises. The promise is returned by the fetch call, and the “then” statement is reached and the function call is placed on the callback queue. The thread of execution is then blocked by a function, and a log statement is reached.
04:22:18 – 04:28:55
Web APIs & Promises Example: Microtask Queue
Will continues diagramming the example involving both web browser APIs and promises. The event loop reports back that the call stack is clear, so the callback (or task) queue is addressed. The concept of a microtask queue is introduced.
04:28:56 – 04:37:05
Promises and Asynchronous Q&A
Will answers several questions from the audience regarding the returned data from the fetch function, whether functions are passed by reference or by value when passed to a web API, arguments within the function passed into the web API, what precedence objects take within the queues, and which functions go into the microtask queue and which go in the callback queue.
04:37:06 – 04:43:13
Promises Review
Will discusses the problems of promises, including that most developers don’t understand them. The benefits introduced include error handling. The features of Promises, web APIs, and the callback, microtask queues, and event loop are reviewed. A final question is asked regarding whether the async await has the same functionality.
Classes & Prototypes
04:43:14 – 04:49:59
Class & OOP Introduction
Will introduces why classes and prototypes are important to learn as a developer, and what will be learned in the upcoming sections. The core idea of development is covered to understand how code should be structured, and how developers write code to be easy to reason about, easy to add new functionality, and efficient. The argument is made that object oriented programming is all of these things.
04:50:00 – 04:54:59
Object Dot Notation
Will provides a scenario in order to make the argument for storing data and functionality together in one place. Dot notation is introduced as a way to allow users to assign and access elements in an object, including functions.
04:55:00 – 05:00:42
Factory Functions
The built-in function Object.create() is introduced as a way to create null objects that provide more control on the object. The concept of the generalized function to produce objects is introduced.
05:00:43 – 05:13:12
Factory Functions Example
Will diagrams an examples of a function that is generalized to accept properties that are assigned to a new object and returned. After demonstrating how easy it is to reason about and utilize in a codebase, Will makes the argument that the approach is unusable.
05:13:13 – 05:17:30
Prototype Chain
Will introduces the prototype chain, or `__proto__` as a way to access functions that were set when Object.create() is used to instantiate an object.
05:17:31 – 05:28:58
Prototype Chain Example: Prototypal Link
Will diagrams an example of a factory function that utilizes Object.create() with the argument of a function with desired functionality to create an object with a prototypal link to the functionality.
05:28:59 – 05:37:13
Prototype Chain Example: Implicit Parameters
Will answers questions from the audience regarding whether only functions can be referenced on the prototypal reference chain, and a clarification as to whether an Object.create() argument is always the `__proto__` property. How to visually see the `__proto__` property in the console is briefly covered. The execution context created when a function called on the prototypal reference chain is diagrammed, and it’s demonstrated how the implicit parameter set in the execution context allows the function work with individual objects despite being shared.
05:37:14 – 05:42:57
hasOwnProperty Method
Will diagrams the hasOwnProperty method to determine whether an object has a specific property to clarify where the property is stored.
05:42:58 – 05:50:39
this Keyword
Will introduces the use case where a function (or several) is created on a function store, and the question is posed as to what the `this` keyword gets assigned to when nested. The call and apply method are introduced as a way to take control of what `this` gets assigned to, which is different than more antiquated methods.
05:50:40 – 05:55:42
Arrow Function Scope & this
Will diagrams an example that demonstrates that the normal `this` keyword rules are overridden when used with arrow functions, because of when arrow function contents are evaluated. A question is asked about what would happen if a method on an object is defined as an arrow function.
05:55:43 – 05:58:46
Prototype Chain Review
Will reviews the last few sections, and how they relate to the standard way of object creation in the proceeding sections.
05:58:47 – 06:10:58
new Keyword
Will introduces the new keyword that takes advantage of javascript’s object-oriented system to automate a factory function.
06:10:59 – 06:26:03
new Keyword Example
Will diagrams what the new keyword is doing under the hood when it’s utilized to instantiate a new object. It’s demonstrated how, through accessing the prototype object, it can automate much of the process that was demonstrated previously in the course.
06:26:04 – 06:39:02
Will introduces the idiomatic way to define when the new keyword needs to be used to instantiate an object. In addition, the syntactic sugar of the class keyword is discussed, and how it really is no different under the hood than what was demonstrated in previous sections.
06:39:03 – 06:42:20
Will concludes the course by summarizing what was covered in the course, as well as suggesting further resources and points of interest to study.
RAPIDGATOR
rapidgator.net/file/5395d2a9e48a0d171a8aa97deca2e9fb/Frontendmasters_-_JavaScript_-_The_Hard_Parts,_v2.part1.rar.html
rapidgator.net/file/7ed4e25e462b98222710baad2f5ac482/Frontendmasters_-_JavaScript_-_The_Hard_Parts,_v2.part2.rar.html
rapidgator.net/file/6a277b2c142919a23ca6f194b38f0f06/Frontendmasters_-_JavaScript_-_The_Hard_Parts,_v2.part3.rar.html
rapidgator.net/file/fa1665c68cc1f7d9c941b1dee93c5fbf/Frontendmasters_-_JavaScript_-_The_Hard_Parts,_v2.part4.rar.html
rapidgator.net/file/530da873ab245b16c73ffac1a51a8033/Frontendmasters_-_JavaScript_-_The_Hard_Parts,_v2.part5.rar.html
rapidgator.net/file/d337f0774cf891ffa829d41b27f4455a/Frontendmasters_-_JavaScript_-_The_Hard_Parts,_v2.part6.rar.html
rapidgator.net/file/77498fb977e20ed23ed1079262c97bc4/Frontendmasters_-_JavaScript_-_The_Hard_Parts,_v2.part7.rar.html
rapidgator.net/file/77e0c3970367091cd35ec8695701d027/Frontendmasters_-_JavaScript_-_The_Hard_Parts,_v2.part8.rar.html
NITROFLARE
nitroflare.com/view/F5A6EA304C872AC/Frontendmasters_-_JavaScript_-_The_Hard_Parts%2C_v2.part1.rar
nitroflare.com/view/C64D2DFB1178421/Frontendmasters_-_JavaScript_-_The_Hard_Parts%2C_v2.part2.rar
nitroflare.com/view/3D50FBF1A08E954/Frontendmasters_-_JavaScript_-_The_Hard_Parts%2C_v2.part3.rar
nitroflare.com/view/D2D615596CC01F0/Frontendmasters_-_JavaScript_-_The_Hard_Parts%2C_v2.part4.rar
nitroflare.com/view/4850DABCD7073DC/Frontendmasters_-_JavaScript_-_The_Hard_Parts%2C_v2.part5.rar
nitroflare.com/view/4B469965DD5B282/Frontendmasters_-_JavaScript_-_The_Hard_Parts%2C_v2.part6.rar
nitroflare.com/view/E2081FCB7F12F72/Frontendmasters_-_JavaScript_-_The_Hard_Parts%2C_v2.part7.rar
nitroflare.com/view/3EF02AADE935327/Frontendmasters_-_JavaScript_-_The_Hard_Parts%2C_v2.part8.rar