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

method definition: function code block assigned to a property

method call: 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

property: function () {}

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

Describe method call syntax (structure).

A

object.property();

i. e.,
calculator. square()

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

functions are defined outside of classes, while methods are defined inside of and part of classes

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

data is encapsulated within objects and the object itself is operated on, rather than its component parts

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

a way to reduce complexity and allow efficient design and implementation in complex software systems; it hides the technical complexity of systems behind simpler APIs

  • helps the user to avoid writing low level code
  • avoids code duplication and increases reusability
  • can change internal implementation of class independently without affecting the user
  • helps to increase security of an application or program as only important details are provided to the user
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

abstraction

a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface

a set of code features (e.g. methods, properties, events, and URLs) that a developer can use in their apps for interacting with components of a user’s web browser, or other software/hardware on the user’s computer, or third party websites and services

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