JavaScript Custom Methods Flashcards
What is a method?
a function which is a property of an object.
How can you tell the difference between a method definition and a method call?
a predefined JavaScript method. It can be used to invoke (call) a method with an owner object as an argument (parameter)
whatever the object is an name the methos and then use preened to call the method
Describe method definition syntax (structure).
property on an object with parameter
Describe method call syntax (structure).
variable = {
method: function() {
…..
}
}
How is a method different from any other function?
a method is associated with an object, while a function is not
What is the defining characteristic of Object-Oriented Programming?
objects can contain both data (as properties) and behavior (as methods)
What are the four “principles” of Object-Oriented Programming?
abstraction, encapsulation, inheritance, polymorphism
What is “abstraction”?
being able to work with (possibly) complex things in simple ways
What does API stand for?
application programming interface
What is the purpose of an API?
a way for two or more computer programs to communicate with each other