javascript-custom-methods Flashcards
What is a method?
A method is a function that is the value of a property in an object. It provides the behavior for the data saved in the property value pairs.
How can you tell the difference between a method definition and a method call?
A method definition has the keyword function and a code block while the method call has the property name associated with the predefined function and a set of parenthesis.
Describe method definition syntax (structure).
The method definition syntax is an object literal that contains a property that will be the methods name and the value of that property will be a function definition.
Describe method call syntax (structure).
A method call is the name of an object then a member operator (.) and the name of that method then some parenthesis.
How is a method different from any other function?
A method only exists within an object and typically acts as the behavior of the data within that object. It has a separate scope from the global functions.
What is the defining characteristic of Object-Oriented Programming?
Abstraction and the use of objects which contains properties and methods acting as data and behaviors.
What are the four “principles” of Object-Oriented Programming?
Abstraction, inheritance, encapsulation, and polymorphism
What is “abstraction”?
Abstraction is taking complex things and creating models that allow people to interact with complex things in a simplified manner.
What does API stand for?
Application programming interface
What is the purpose of an API?
To provide a consist and simplified way for two or more computer programs to interact with each other.