es6-classes Flashcards
1
Q
What is “syntactic sugar”?
A
syntactic sugar is syntax that is designed to make things easier to read or to express.
2
Q
What is the typeof an ES6 class?
A
it’s a function.
3
Q
Describe ES6 class syntax.
A
1) starts with class keyword, followed by name and curly braces.
2) then inside the code block, a OPTIONAL constructor method
class Person {
constructor(name) {
this.name = name;
}
3) methods..
getName() {
return this.name;
}
}
4
Q
What is “refactoring”?
A
refactoring is the process of restructuring the existing code , it is intended to improve the design, structure and/or implementation without changing its external behavior.
rewriting cleaner code and make it more efficient.