Stay Down Dev Log - Part 11 - Understanding "this" In Destructured Functions
In this magical code refactoring dev log, I run into an issue with destructuring functions out of the global object and have to figure out how to fix it. I also fix a position issue with the score counter.
This video will help you understand how the "this" keyword works inside of a function and goes over an issue you may encounter when destructuring functions out of objects. A few solutions I didn't talk about are binding "this" to the destructured function, and using closures to make a local copy of "this" in your function.
What you'll learn in this video:
00:00:54 - Explaining the issue
00:05:10 - A few ways to fix the issue
00:07:03 - Testing a potential oversight with self referencing
00:09:10 - My solution to the problem: private properties!
00:23:00 - Repositioning the score counter
Check out the website for more projects, videos, and source code! https://pothonprogramming.github.io
Join the Discord for some conversation: https://discord.gg/fTNxCXv
-
17:39
Poth On Programming
3 years agoStay Down Dev Log - Part 9 - Destructuring Objects
20 -
4:44
LearnCode.academy
1 year agoJavascript Closures Tutorial - What makes Javascript Weird...and Awesome Pt 3
49 -
27:37
Free Skills
2 years agoComplete Web Developer Chapter 3 - Lesson 9 Functions
13 -
2:28
T & M
3 months agoObject Destructuring in Javascript
4 -
5:15
LearnCode.academy
1 year agoJavascript is Event-Driven - What makes Javascript Weird...and Awesome Pt 2
14 -
13:48
LearnCode.academy
1 year agoJavascript Tutorial For Beginners - #3 Javascript Functions Tutorial
14 -
14:04
TecH WaveS Videos
3 years ago $0.01 earned8 JavaScript Tricks - Must Know
112 -
16:32
Tech With Tim
1 year ago $0.01 earnedRust Tutorial #8 - Functions, Expressions & Statements
48 -
5:48
EasilyCoded
1 year agoUnderstand the Key Differences Between Deep Copying and Shallow Copying in JavaScript
10 -
7:44
Datakademy
2 years agoFunctions in Python | Python Tutorial Ep14
18