javascript-custom-methods Flashcards

1
Q

What is amethod?

A
A method is a function which is a property of an object.
function definition assigned to a property.
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 methoddefinitionand a methodcall?

A

method definition: starts with the function keyword followed by a code block
method call: values inside parenthesis

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

Describe methoddefinitionsyntax (structure).

A

subtract: function (x, y) {
return x - y;
}

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

Describe methodcallsyntax (structure).

A

obj name dot method name, parenthesis

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

a method is associated with an object,

need dot notation or bracket notation

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

What is thedefining characteristicof Object-Oriented Programming?

A

objects can contain both data (as properties) and behavior (as methods).

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

being able to work with (possibly) complex things in simple ways

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 (API)

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

interactions between multiple software intermediaries

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