Thank you for these amazingly elaborated tutorials, with these weapons, I feel I am no longer afraid of facing real problem alone. Thank you.
@innai_fox5 жыл бұрын
Finally! I've found someone, who likes movies and JavaScript in the same time, as I do ^_^. And by the way, thanks for crystal clear explanation of private fields
@GodofStories4 жыл бұрын
Me too Inna, mind if ?I slideeee in your DM's ? .
@dineshthangavel4 жыл бұрын
helped me greatly while revising my js essentials...never knew i cud make a setter and getter like that. great video!, do keep making more
@SteveGriffith-Prof3ssorSt3v34 жыл бұрын
I plan to keep making many more. New ones pretty much every week. Please share them if they help you.
@dineshthangavel4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 i definitely will!
@rolikaseventysix4 жыл бұрын
Very informative and your voice is amazing, thanks for your effort!
@Kapreski7 жыл бұрын
normally a variable inside of a function is removed from memory after its parent function is executed, how comes this IIFE function keeps a reference to '_prop1' variable, and how does it know that it needs to keep that reference ?
@SteveGriffith-Prof3ssorSt3v37 жыл бұрын
That's because we are creating a closure. When the inner function makes reference to the variable in the outer function we are protecting it from being destroyed. I have another video about Closures here - kzbin.info/www/bejne/gWrJm4COa6tonKc
@Kapreski7 жыл бұрын
great videos! thank you
@MrMarkgyuro5 жыл бұрын
finally, a Big Lebowski fan :)
@chesterxp5083 жыл бұрын
Another very cool tutorial !!!
@uchennachukwuba11 ай бұрын
What if a user tries both the obj.prop1 and obj.prop1(Val)? The setter will change the private value
@SteveGriffith-Prof3ssorSt3v311 ай бұрын
The set method is designed to be the only way that the user can change the private value. It forces the user to go through your function which can do validation of the new value before setting it.
@romeojoseph766 Жыл бұрын
great tutorial, it would be great if you can create a video about the same topic as this video but using constructor I mean like class and new keyword ...... those stuff , ,you know
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
kzbin.info/www/bejne/qqKlgWiQjZ15ZsU
@romeojoseph766 Жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 thanks a ton for replying all of my comments and questions🙂🙂🙂 !!
@stannikolov3 жыл бұрын
Do private properties and methods in JS classes (#prop, #method) use the same technique behind the scenes? Or they have some other way to hide?
@SteveGriffith-Prof3ssorSt3v33 жыл бұрын
There are different approaches to create private data inside classes, as outlined here by Axel Rauchmayer - exploringjs.com/es6/ch_classes.html#sec_private-data-for-classes This was all before the #private syntax was added. Honestly, I'm not sure whether they used closures or something else behind the scenes. I'm just happy to not have to think about it as much as before. :)