es6-classes Flashcards

1
Q

What is “syntactic sugar”?

A

a term used in computer science to describe language constructs or notations that make a programming language easier to read or write, without changing its underlying meaning or behavior. It provides a more convenient or expressive way to perform operations that could be done in a more verbose or complex manner without it.

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

When used on an instance of an ES6 class, typeof will return the string “object”. When used on the class constructor function itself, it will return “function”.

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

Describe ES6 class syntax.

A

class MyClass {
constructor(arg1, arg2) {
this.property1 = arg1;
this.property2 = arg2;
}

method1() {
// implementation of method1
}

method2() {
// implementation of method2
}
}

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

What is “refactoring”?

A

“Refactoring” is the process of changing the structure of existing code to improve its readability, maintainability, or performance, without changing its functionality or behavior.

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