JS Custom Methods Flashcards
What is a method?
A method is a function that is a property of an object.
How can you tell the difference between a method definition and a method call?
A method definition would have the keyword function and { } for the function code block.
A method call would have the object followed by dot notation, name of method and then ( ).
Describe method definition syntax (structure).
{ property: function methodName ( [<i>optional parameters</i>] ) {<i>code block </i>}, }
Describe method call syntax (structure).
object.methodName( )
How is a method different from any other function?
Needs dot notation or bracket notation. Also a method belongs to an object as a property of the object.
What is the defining characteristic of 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 does API stand for?
Application Programming Interface
What is “abstraction”?
It is a process that enables a user to work with (possibly) complex things in simply ways.
What is the purpose of an API?
Selection of tools (set of code features such as methods, properties, events, and URLS) to make it easier for developers to interact with a software.