es6-classes Flashcards

1
Q

What is “syntactic sugar”?

A

syntax that makes code easier to read/express.

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

What is the typeof an ES6 class?

A

object

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

Describe ES6 class syntax.

A
  • class keyword, followed by the class name (class definition)
  • within the class body you have the
  • definition of constructor() prototype method which assigns properties to the instance.
    • its parameters are the names of the properties you want to define.
    • its code block contains the initialization of the variables in the parameter to this.<propertyName></propertyName>
  • followed by the rest of the definitions of the prototype methods that the object will carry.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is “refactoring”?

A

when you rewrite code (usually to make it look cleaner) but it’s functionality stays the same

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