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 34:03Poth On Programming4 years agoStay Down Dev Log - Part 7 - PLATFORM COLLISION!!!26
- 	
				 17:39 17:39Poth On Programming4 years agoStay Down Dev Log - Part 9 - Destructuring Objects21
- 	
				 42:04 42:04Poth On Programming4 years agoStay Down Dev Log - Part 12 - GRAPHICS!26
- 	
				 42:27 42:27Poth On Programming4 years agoStay Down Dev Log - Part 8 - COLLECT ITEMS3
- 	
				 41:04 41:04Poth On Programming4 years agoStay Down Dev Log - Part 6 - Jump On Platforms!!!7
- 	
				 10:58 10:58Poth On Programming4 years agoStay Down Dev Log - Part 5 - Improved Keyboard Controls20
- 	
				 56:52 56:52Poth On Programming4 years agoStay Down Dev Log - Part 14 - Background Graphics!20
- 	
				 1:15:59 1:15:59Poth On Programming4 years agoStay Down Dev Log - Part 4 - MAJOR REFACTORING, Game States!10
- 	
				 50:45 50:45Poth On Programming4 years agoStay Down Dev Log - Part 15 - Custom Text Graphics46
- 	
				 28:11 28:11High School Math4 years ago $0.14 earnedIM3 Alg2CC 5.2 Transformation of functions part 2180