js custom methods Flashcards

1
Q

What is a method?

A

a function which is a 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

they look very different:
method definition is defined inside the object
method call has object.method();

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

Describe method definition syntax (structure).

A
const myObject = {
 myMethod: function (args) {
  //code
 }
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe method call syntax (structure).

A

myObject.myMethod();

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’s inside 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 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: simplification of a greater idea into something like an object that describes the whole with less information

Encapsulation: bundling data with methods in objects, keeping them separated from the rest of code

Inheritance: mechanism of basing an object or class on another object or class, retaining similar implementation

Polymorphism: use of a single interface with different types

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

What is “abstraction”?

A

Simplification of a larger system into an interface with only required information. Creating your very own black box

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

give programmers a way to interact with a system in a simplified and consistent fashion.

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