Javascript Custom Methods Flashcards
What is a method?
a property function of an object.
How can you tell the difference between a method definition and a method call?
a method call is attached to an object while a method definition has the function being written.
Describe method definition syntax (structure).
var object = {
property: function() {
code block
},
};
Describe method call syntax (structure).
object.method(parameter);
How is a method different from any other function?
It is attached to only that object
What is the defining characteristic of Object-Oriented Programming?
contains data as properties and behaviors
What are the four “principles” of Object-Oriented Programming?
Abstraction, Encapsulation, inheritance, polymorphism.
What is “abstraction”?
the ability to work with data in simple methods
What does API stand for?
application programing interface
What is the purpose of an API?
gives us easy access to a database