ES6 Classes Flashcards
1
Q
What are JavaScript classes?
A
Templates for creating objects
2
Q
When would you want to use a class?
A
inherit properties/functions
3
Q
How do you declare a class?
A
class ‘name’ (parameters) {
}
4
Q
How do you inherit from another class?
A
class ‘name’ extends ‘inherited class’
5
Q
Why would you want to inherit from another class?
A
general or useful functions from another class
6
Q
How do you add methods and properties to a class?
A
class ‘name’ (parameters) {
this.class = class;
function ‘name’ () => {
}