Learning Fuze Mod 2 - Javascript Flashcards
What is a method?
a property of an object that contains a function definition
How can you tell the difference between a method definition and a method call?
one is defined with a body and if it doesn’t have the body its a call
Describe method definition syntax (structure).
lick: function () {
return ‘mlem’;
}
Describe method call syntax (structure).
object.method()
How is a method different from any other function?
its pre defined
What is the defining characteristic of Object-Oriented Programming?
object’s own procedures can access and often modify the data fields of itself
What are the four “principles” of Object-Oriented Programming?
Abstraction
Encapsulation
Inheritance
Polymorphism
What is “abstraction”?
a way of representing a complex process with a series of steps
What does API stand for?
Application programming interface
What is the purpose of an API?
a way for programs to communicate with each other
What is this in JavaScript?
a JavaScript keywords that references the current object. It has different values depending on where it is used: In a method, this refers to the owner object. Alone, this refers to the global object. In a function, this refers to the global object.
What does it mean to say that this is an “implicit parameter”?
The implicit parameter in Java is the object that the method belongs to. It’s passed by specifying the reference or variable of the object before the name of the method.
When is the value of this determined in a function; call time or definition time?
call time
What does this refer to in the following code snippet?
- the character object.
Given the above character object, what is the result of the following code snippet? Why?
- its a me mario!