oop - What is encapsulation in context of JavaScript? -
what encapsulation in context of javascript? i'm confused after reading statement in mozilla web-site(link):
encapsulation
in previous example, student not need know how person class's walk() method implemented, still can use method; student class doesn't need explicitly define method unless want change it. called encapsulation, every class inherits methods of parent , needs define things wishes change.
i've understood encapsulation hiding class members, in example on mozilla site seems simple inheritance.
it means don't have able build tools you're using use them.
it's makes programming lot less stressful when can abstract things away.
have ever used alert()
method in javascript?
i'm sure you'd feel bit overwhelmed if had care how alert
communicates browser, , how browser communicates display , layers in-between.
you don't want worry bezier curves used render fonts or how implement ok
button, or other code makes alert
work. know can write alert("txt")
in javascript, , dialog box appear.
Comments
Post a Comment