Object-Oriented Programming Flashcards
What is a method?
a function which is a property of an object.
How can you tell the difference between a method definition and a method call?
method definition has function code block while method call has the method(arguments)
Describe method definition syntax (structure).
property name : function method
Describe method call syntax (structure).
object.method(arguments)
How is a method different from any other function?
look for a dot too see if its a method if not its a function
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, and 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?
a way to interact with a system in a simplified, consistent fashion
What is this in JavaScript?
it is a keyword that references the object
What does it mean to say that this is an “implicit parameter”?
When is the value of this determined in a function; call time or definition time?
call time because it is a parameter and a parameter is only called
What kind of inheritance does the JavaScript programming language use?
prototype-based or prototypal
What is a prototype in JavaScript?
a source for other objects to inherit its data and behavior within