javascript-custom-methods Flashcards
What is a method?
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?
a method definition is a property and also a function inside an object, a method call is to call a function that belongs to an object.
Describe method definition syntax (structure).
(property)method name, parenthesis, curly braces for the function code. or (property)method name, colon, function keyword, parenthesis with zero or more parameters, curly braces for the function code.
Describe method call syntax (structure).
object name dot method(arguments)
How is a method different from any other function?
method is attached to object, function can be separate
What is the defining characteristic of Object-Oriented Programming?
take related data and function and put it in an object, Object-oriented programming is a programming paradigm 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 (often known as methods).
What are the four “principles” of Object-Oriented Programming?
Abstraction, Encapsulation, Inheritance, Polymorphism
What is “abstraction”?
a simplified way to work with complex things
What does API stand for?
Application programming interface
What is the purpose of an API?
it allows apps to send information between each other.