javascript-custom-methods Flashcards
What is a method?
it is a function defintion that is assigned to a property function stored as a property in an object
How can you tell the difference between a method definition and a method call?
- call –> object.call()–> has paranthesis.
2. definition –> funcction defintion + code block
Describe method definition syntax (structure).
have a property name: function keyword (parameters) {
code block}
object.property –>and then assign funcction
Describe method call syntax (structure).
object name.methodname();
How is a method different from any other function?
we need dot or bracket notation to show where that method is coming from.
its insidde an object
What is the defining characteristic of Object-Oriented Programming?
Objects can container datas and behavior under the object
What are the four “principles” of Object-Oriented Programming?
- abstraction
- encapsulation
- inheritance
- polymorphism
What is “abstraction”?
Making complex things into simply ways. (lightswitch)
What does API stand for?
Application programming interface
What is the purpose of an API?
allows users to use the interface independently of the implementation (abstraction).
Allows users to work with the system in a simple way fashion