javascript-custom-methods Flashcards

1
Q

What is a method?

A

its a function that is stored in the property of an object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can you tell the difference between a method definition and a method call?

A

when a method is called you will see it on the right side of an object with a dot between the two and a set of parentheses for a possible argument. Meanwhile when it’s being defined, you have an anonymous function being defined as the value of a property within an object literal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe method definition syntax (structure).

A

property name: function keyword (parameter) {
function code block
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe method call syntax (structure).

A

objectName.methodCall(argument)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How is a method different from any other function?

A

it can only be called as the property of an object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the defining characteristic of Object-Oriented Programming?

A

objects can contain both data(as properties) and behaviors(as methods)

data and behavior are grouped together

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the four “principles” of Object-Oriented Programming?

A

Abstraction:
Encapsulation:
Inheritance:
Polymorphism:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is “abstraction”?

A

the dumbing down of complex systems that allow you to focus attention on details of greater importance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does API stand for?

A

Application Programming Interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of an API?

A

creates abstractions that allows you to interact with a complex system.

interfaces were created for you to interface with the electrical circuitry of a light bulb
aka light switch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly