javascript-custom-methods Flashcards

1
Q

What is a method?

A

A function that 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

A method definition would have the keyword function and { } for the function code block.
A method call would have the object followed by dot notation, name of method and then ( ).

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

Describe method definition syntax (structure).

A

{ property: function methodName ( [optional parameters] ) {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

object.methodName( )

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

What is “abstraction”?

A

It is a process that enables a user to work with (possibly) complex things in simply ways.

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

What is the purpose of an API?

A

Selection of tools (set of code features such as methods, properties, events, and URLS) to make it easier for developers to interact with a software.

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

How is a method different from any other function?

A

a method is associated with a property while a function is not

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