What are Getters and Setters? - JavaScript Tutorial for Beginners

preview_player
Показать описание
In today's video we're going to take a look at the power of getters and setters in JavaScript, which can be used on object literals of ES6 classes.

For your reference, check this out:

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

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

Really great video, I was struggling to understand before I watched ur video but now everything`s pretty clear, thank you!!!

de
Автор

dawg this is the video that did it for me, thanks bro!

elvislopez
Автор

5:38 I'm yet to find an explanation to why we use "=" sign here and not write it like "person.primaryInterest("Home Automation")"

Tracer
Автор

Explanation more than wonderful
Thank you very much
To make information easy

sajaahmed
Автор

Hey man. I've started learning JS again and i have to say i again find myself ending up on your channel a lot, just like the first time when i was learning.
Good content, brotha

TheLuckyyy
Автор

Great video, really well explained!
what font do you use btw?

ToadyEN
Автор

Great video man! What extension theme are you using for the color of the text?

hatef
Автор

This improved my incomplete knowledge about getter, setter and the this._name thing

blackpurple
Автор

Great video as usual, cheers!
what's the theme in this video?

aandersn
Автор

Anyone know why his framerate on vscode appears so smooth?

NrOx
Автор

Is there a way to protect the underscore field from external access? I can still manipulate it directly outside the class.

andrew_ortega
Автор

All of this can be done on an object with a object method just as same
So what is the point of using getters?

davesharma
Автор

Great video)👍
But silly me didn't really get the underscore part)

КравецРостислав
Автор

how does _name work when it is name in constructor?

ammarhassan_
Автор

aren't getters and setters same as defining methods on an object

sulejmanzekotic
Автор

Hey Dcode,
How long did it take you to understand JS on a proficient level? Like independently being able to code without reference?
Could you share any learning methods?
Greet video btw
Thanks

hassansyed
Автор

could you do an application where we store an object in local storage and get the item. very good. i have been looking for this tutorial

poetpenton
Автор

so underscores are always needed for setters and getters in classes? is it like a reserved character?

elAmigo
Автор

i still can't see how this is useful in any way. can't you just do your validation/handling inside the constructor and call it a day? what is the advantage here? or am i really dumb? please enlighten me

babicunlo
Автор

Good video but I need to check video on _variable

moneyfr