JavaScript Getters and Setters | Mosh

preview_player
Показать описание
JavaScript Getters and Setters

Subscribe for more videos:

Want to learn more from me? Check out my blog and courses:

Рекомендации по теме
Комментарии
Автор

I don't understand why everyone can't explain this topic in the same way. Brilliant. Thank you very much!

k.safonov
Автор

So much better than the CodeCademy explanation!

JeremyGalloway
Автор

You know why this is great? Because instead of just telling someone what to write and blow their mind you actually explain HOW what you are explaining came to be and WHY you would need it. Not just write this and try to get this. That is the x factor when it comes to coding tutorials. Well done as usual Mosh, I hope that made sense.

TheJackTheLion
Автор

you could also use:
set fullName(value) {
[this.firstName, this.lastName] = value.split(' ')
}

annasezen
Автор

Thank you for the awesome explanation, John Smith!!

guoxinn
Автор

thank you, my current courses' explanation of how this works and its' use case was super clumsy.

Calupp
Автор

Getters and Setters:
2:38-3:04, contextual use case
3:05-3:14, purpose/rule
3:14-5:37, how to prepare

climbers
Автор

Mosh should teach every course, no fluff, straight to the point!

RyanGordy
Автор

Thank you for explaining this from first principles.

Starting with a simple object, giving scenarios for why you'd need to implement this, and going from there.

ahmadraja
Автор

I can't believe I was able to understand this in 6 minutes compared to 3 hours of lectures. Saved my life for the exam, thanks lol

krisilyubenov
Автор

Glad you started this video with a reason why we need this👍

zakhariihusar
Автор

This video answered ALL my questions on getters & setters. Thanks so much!

julibeeee
Автор

You're wonderful at explaining topics like these, bravo!

alexlun
Автор

Very simply explained! Formerly I got lost when other people described the same topic. Thank you very much!

Baltie
Автор

Ohhhh, so that's the difference, I finally understood, thank you very much. 💕 Awesome explanation.

This is the kind of stuff I read before for the question "What's the difference/advantage of a getter over a simple method?", I don't know if it resolves the question because I didn't understood a thing:
-"Given that without a getter, all we can do is poll the attribute for its value, anything else would require a special method which we would have to invoke on the value. Not insurmountable, but will take some thought."

Reading that again made me forget what I saw in the video, I need to rewatch. 😂

BHVampireLF
Автор

Amazing! I understood this better than others spanish channels. Thank you

dianaordonez
Автор

This made so much more sense, thank you for the video. Hope you are doing well.

armandvermeulen
Автор

English subtitles: Mosh Hamedani ( Marsh comma daddy )

joeya
Автор

Simple and clean explanation, lovely!

natefrst
Автор

Hi nice tutorial, but why can't we do the smae task whitout naming those functions get and set?

mateuszjamroz