javascript-custom-methods Flashcards
What is a method?
A method is a function that is a property of an object.
How can you tell the difference between a method definition and a method call?
a method definition is a way of creating a new method for an object while a method call is the act of executing a method
Describe method definition syntax (structure).
const object = {
methodName: function(parameters) {
// method body
}
};
Describe method call syntax (structure).
object.method(arguments)
How is a method different from any other function?
A method is a function which is a property of an object.
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 (API)
what is the purpose of an API
To programmatically interface with an application