Private Variables in JavaScript

  Рет қаралды 12,392

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

Пікірлер: 24
@rotrose7531
@rotrose7531 4 жыл бұрын
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_fox
@innai_fox 5 жыл бұрын
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
@GodofStories
@GodofStories 4 жыл бұрын
Me too Inna, mind if ?I slideeee in your DM's ? .
@dineshthangavel
@dineshthangavel 4 жыл бұрын
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-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
I plan to keep making many more. New ones pretty much every week. Please share them if they help you.
@dineshthangavel
@dineshthangavel 4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 i definitely will!
@rolikaseventysix
@rolikaseventysix 4 жыл бұрын
Very informative and your voice is amazing, thanks for your effort!
@Kapreski
@Kapreski 7 жыл бұрын
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-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 7 жыл бұрын
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
@Kapreski
@Kapreski 7 жыл бұрын
great videos! thank you
@MrMarkgyuro
@MrMarkgyuro 5 жыл бұрын
finally, a Big Lebowski fan :)
@chesterxp508
@chesterxp508 3 жыл бұрын
Another very cool tutorial !!!
@uchennachukwuba
@uchennachukwuba 11 ай бұрын
What if a user tries both the obj.prop1 and obj.prop1(Val)? The setter will change the private value
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 11 ай бұрын
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
@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
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
kzbin.info/www/bejne/qqKlgWiQjZ15ZsU
@romeojoseph766
@romeojoseph766 Жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 thanks a ton for replying all of my comments and questions🙂🙂🙂 !!
@stannikolov
@stannikolov 3 жыл бұрын
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-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
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. :)
@stannikolov
@stannikolov 3 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Thank you!
JavaScript Chaining Array Methods and Using Arrow Functions
8:06
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 12 М.
JavaScript Classes vs Prototypes
14:39
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 63 М.
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
JavaScript Proxies
22:54
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 11 М.
STOP Using Classes In JavaScript | Prime Reacts
14:02
ThePrimeTime
Рет қаралды 256 М.
Checking for the Existence of JavaScript Variables
9:08
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 3,5 М.
Understanding the Keyword THIS in JavaScript
13:59
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 9 М.
Differences Between Var, Let, and Const
8:37
Web Dev Simplified
Рет қаралды 196 М.
JavaScript OOP Crash Course (ES5 & ES6)
40:21
Traversy Media
Рет қаралды 594 М.
JavaScript GETTERS & SETTERS are awesome!!! 📐
13:14
Bro Code
Рет қаралды 20 М.
Getter and setter properties in JavaScript
17:18
procademy
Рет қаралды 8 М.
Deep Copying vs Shallow Copying
13:35
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 23 М.
Inheritance in JavaScript - Prototypal Inheritance tutorial
20:06
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН