javascript-custom-methods Flashcards
What is amethod?
A method is a function which is a property of an object. function definition assigned to a property.
How can you tell the difference between a methoddefinitionand a methodcall?
method definition: starts with the function keyword followed by a code block
method call: values inside parenthesis
Describe methoddefinitionsyntax (structure).
subtract: function (x, y) {
return x - y;
}
Describe methodcallsyntax (structure).
obj name dot method name, parenthesis
How is a method different from any other function?
a method is associated with an object,
need dot notation or bracket notation
What is thedefining characteristicof 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 (API)
What is the purpose of an API?
interactions between multiple software intermediaries