javascript-custom-methods Flashcards
What is a method?
its a function that is stored in the property of an object
How can you tell the difference between a method definition and a method call?
when a method is called you will see it on the right side of an object with a dot between the two and a set of parentheses for a possible argument. Meanwhile when it’s being defined, you have an anonymous function being defined as the value of a property within an object literal.
Describe method definition syntax (structure).
property name: function keyword (parameter) {
function code block
}
Describe method call syntax (structure).
objectName.methodCall(argument)
How is a method different from any other function?
it can only be called as the property of an object
What is the defining characteristic of Object-Oriented Programming?
objects can contain both data(as properties) and behaviors(as methods)
data and behavior are grouped together
What are the four “principles” of Object-Oriented Programming?
Abstraction:
Encapsulation:
Inheritance:
Polymorphism:
What is “abstraction”?
the dumbing down of complex systems that allow you to focus attention on details of greater importance
What does API stand for?
Application Programming Interface
What is the purpose of an API?
creates abstractions that allows you to interact with a complex system.
interfaces were created for you to interface with the electrical circuitry of a light bulb
aka light switch