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?
method definitions are declared functions that are values of an object’s property. Method calls always distinguished by adding parentheses when they are declared.
Describe method definition syntax (structure).
Within the function, create a property and assign it a value of an anonymous function that carries out a task.
Describe method call syntax (structure).
object name + dot + method name + parentheses where arguments will be passed if any
How is a method different from any other function?
It is a property within an object, otherwise, it is no different from a function.
What is the defining characteristic of Object-Oriented Programming?
It is based on the concept of “objects”, which can contain data and code: data in the form of fields (often known as attributes or properties), and code, in the form of procedures or functions (often known as methods).
What are the four “principles” of Object-Oriented Programming?
Abstraction
Encapsulation
Inheritance
Polymorphism
What is “abstraction”?
The ability to work with complex things in simple ways
What does API stand for?
Application Programming Interface
What is the purpose of an API?
‘API’ is a computing interface that defines interactions between multiple software intermediaries.