javascript-custom-methods Flashcards

1
Q

What is a method?

A
it is a function defintion that is assigned to a property
function stored as a property in 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
  1. call –> object.call()–> has paranthesis.

2. definition –> funcction defintion + code block

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

Describe method definition syntax (structure).

A

have a property name: function keyword (parameters) {
code block}
object.property –>and then assign funcction

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

Describe method call syntax (structure).

A

object name.methodname();

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

we need dot or bracket notation to show where that method is coming from.
its insidde 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 container datas and behavior under the object

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
  1. abstraction
  2. encapsulation
  3. inheritance
  4. polymorphism
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is “abstraction”?

A

Making complex things into simply ways. (lightswitch)

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

allows users to use the interface independently of the implementation (abstraction).
Allows users to work with the system in a simple way fashion

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