JS custom methods Flashcards
What is a method?
is a function which is a property of an object. There are two kind of methods: Instance Methods which are built-in tasks performed by an object instance, or Static Methods which are tasks that are called directly on an object constructor.
How can you tell the difference between a method definition and a method call?
method definition is deinining the method and calling is using it
Describe method definition syntax (structure).
const obj = { foo() { return 'bar'; } };
Describe method call syntax (structure).
method ()
How is a method different from any other function?
You can create any kind of method
What is the defining characteristic of Object-Oriented Programming?
based on the concept of “objects”, which can contain data and code
What are the four “principles” of Object-Oriented Programming?
Abstraction
Encapsulation
Inheritance
Polymorphism
What is “abstraction”?
the process of removing physical, spatial, or temporal details[2] or attributes in the study of objects or systems to focus attention on details of greater importance;[3] it is similar in nature to the process of generalization;
the creation of abstract concept-objects by mirroring common features or attributes of various non-abstract objects or systems of study[3] – the result of the process of abstraction.
What does API stand for?
application programming interface
What is the purpose of an API?
It defines the kinds of calls or requests that can be made, how to make them, the data formats that should be used, the conventions to follow, etc