javascript-custom-methods Flashcards
What is a method?
A method is a function which is a property of an object.
How can you tell the difference between a method definition and a method call?
A method call has the object name to the left of the method invocation where a method definition is a property of an object and it has a body inside curly brackets that defines the function.
Describe method definition syntax (structure).
- name of method
- parens and parameters if applicable
- curly braces with definition inside
Describe method call syntax (structure).
- name of object
- dot notation with name of method
- parens with applicable arguments
How is a method different from any other function?
A method is associated with an object where a function is not.
What is the defining characteristic of Object-Oriented Programming?
-objects
What are the four “principles” of Object-Oriented Programming?
- Abstraction
- Encapsulation
- Inheritance
- Polymorphism
What is “abstraction”?
The ability to work with (possibly) complex things in simple ways.
What does API stand for?
-Application Programming Interface
What is the purpose of an API?
APls let programs talk to each other.