ES6 Classes Flashcards

1
Q

What are JavaScript classes?

A

Templates for creating objects

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

When would you want to use a class?

A

inherit properties/functions

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

How do you declare a class?

A

class ‘name’ (parameters) {
}

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

How do you inherit from another class?

A

class ‘name’ extends ‘inherited class’

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

Why would you want to inherit from another class?

A

general or useful functions from another class

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

How do you add methods and properties to a class?

A

class ‘name’ (parameters) {
this.class = class;
function ‘name’ () => {
}

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