JS custom methods Flashcards
What is a method?
a function that is a property of an object
How can you tell the difference between a method definition and a method call?
equal sign and curly braces– assigning to property
Describe method definition syntax (structure).
var keyword, objectName = {property: function definition} function definition assigned to a property
Describe method call syntax (structure).
objectName.methodName( )
How is a method different from any other function?
functions live on their own and methods live within objects
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”?
a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency.
taking complex behavior and making it accessible/easy to interact with
What is the purpose of an API?
connection between computer programs / software..tools available to the programmer
What is the purpose of an API?
connection between computer programs / software..tools available to the programmer