javascript-custom-methods 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?
Definition has the function keyword, parameters, and code block. Call is written with the object followed by dot notation, the name of the method and then the argument(s)
Describe method definition syntax (structure).
Within the object, property: function keyword (optional parameters) {code block}
Describe method call syntax (structure).
object.methodName(optional arguments)
How is a method different from any other function?
A method is a property of an object
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”?
Being able to work with (possibly) complex things in simple ways
What does API stand for?
Application Programming Interface
What is the purpose of an API?
Constructs made available in programming languages to allow developers to create complex functionality more easily