Getter and setter properties in JavaScript

preview_player
Показать описание
In this lecture, you will learn, what is getter and setter properties are and how to use them in your JavaScript program. Getter and setter properties were introduced with the release of ECMAScript 5.
Рекомендации по теме
Комментарии
Автор

One of the most well explained videos that I have seen and I have seen a lot of videos. Really appreciate it. It is a shame that this channel's videos have gotten so much less views.

Jack
Автор

Best lecture, After searching lot of lectures, I find this. Thank you 🙏

kartickchandramanna
Автор

Watched the first few youtube recommendation for getter and setter which made me more chaotic ..THIS WAS CRYSTAL CLEAR .THANKS BROTHER . KEEP GOING

Ansha-xquy
Автор

Best tutorial about getter setter out of the several videos I watched. Thank you!

xpantia
Автор

That's literaly the best video i've seem about getters and setters on javascript. Thanks man!

MoneymakerGrowingFast
Автор

you made it so easy to understand. Thank you for your hard work, sir.

dyracho
Автор

PLEASE RELEASE TUTORIAL ON BACKEND LAMGUAGES LIKE JAVA/PYTHON/C++/PHP

dicksoncyprian
Автор

Hi,

I am new to programming, but as far as I know, in langauges like C#, you can make a property private, i.e., truly encapsulate it, hence making the use of getters and setter a NECESSITY, but here why would I NEED to use getters and setters when I can easily access and modify the properties? You said there are two reasons:

1) Encapsulation
2) When you modify/calculate a value.

The second one makes sense, but you didn't give an example for the first one: how can you hide your data from the world when you can't make it private? Or maybe you can?

Thanks,

farazk
Автор

Sir, I cannot have either get or set property alone. Although I only write get method for company, I can still set as User.company = 'abc' and company changed.

dyracho
Автор

All properties in this tutorial are public, so we always have access to them. How to make properties in JavaScript private?

slobodantajisic
Автор

You made it super easy to understand. Thanks for the video. God bless you

clickherenow