Premium Only Content
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
-
34:03
Poth On Programming
4 years agoStay Down Dev Log - Part 7 - PLATFORM COLLISION!!!
19 -
17:39
Poth On Programming
4 years agoStay Down Dev Log - Part 9 - Destructuring Objects
20 -
42:04
Poth On Programming
4 years agoStay Down Dev Log - Part 12 - GRAPHICS!
22 -
42:27
Poth On Programming
4 years agoStay Down Dev Log - Part 8 - COLLECT ITEMS
2 -
41:04
Poth On Programming
4 years agoStay Down Dev Log - Part 6 - Jump On Platforms!!!
5 -
10:58
Poth On Programming
4 years agoStay Down Dev Log - Part 5 - Improved Keyboard Controls
19 -
56:52
Poth On Programming
4 years agoStay Down Dev Log - Part 14 - Background Graphics!
20 -
1:15:59
Poth On Programming
4 years agoStay Down Dev Log - Part 4 - MAJOR REFACTORING, Game States!
8 -
50:45
Poth On Programming
4 years agoStay Down Dev Log - Part 15 - Custom Text Graphics
44 -
28:11
High School Math
4 years ago $0.14 earnedIM3 Alg2CC 5.2 Transformation of functions part 2
179