Chapter 1. Introduction Flashcards

1
Q

Does JavaScript have classes?

A

No. But functions are fist-class objects.

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

What is a design pattern?

A

A best practice, useful abstraction and a template for solving categories of problems.

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

Why are design patterns beneficial?

A
  1. Write code to proven practices, thereby encouraging code re-use.
  2. Provide level of abstration.
  3. Improve communication by labeling a technique or approach.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a software Code Pattern?

A

Language-specific patterns and good practices.

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

What is an anti-pattern?

A

A common approach that causes more problems than is solves.

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

What are the five primitive types that are NOT objects?

A

Number, string, boolean, null, undefined.

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

Why is a JavaScript variable object-like?

A
  1. It’s a property of the internal Activation Object. If it’s a global, the global object.
  2. It has attributes (only exposed in some ECMA v5 methods).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a JavaScript object?

A

A collection of names properties, a list of key-value pairs.

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

What are native objects?

A

Objects defined by the language in the ECMA script standard, also* built-in*.

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

What are host objects?

A

Browser and document-specific objects, like the window and all DOM elements.

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

True or False?

There classes in JavaScript.

A

False.

JavaScript has only objects, which the Gang of Four favors as a general guideline: “Prefer object composition to class inheritance.”

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

True of False?

JavaScript has inheritance.

A

True.

Accomplished usually by prototypes.

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