Chapter 1. Introduction Flashcards
Does JavaScript have classes?
No. But functions are fist-class objects.
What is a design pattern?
A best practice, useful abstraction and a template for solving categories of problems.
Why are design patterns beneficial?
- Write code to proven practices, thereby encouraging code re-use.
- Provide level of abstration.
- Improve communication by labeling a technique or approach.
What is a software Code Pattern?
Language-specific patterns and good practices.
What is an anti-pattern?
A common approach that causes more problems than is solves.
What are the five primitive types that are NOT objects?
Number, string, boolean, null, undefined.
Why is a JavaScript variable object-like?
- It’s a property of the internal Activation Object. If it’s a global, the global object.
- It has attributes (only exposed in some ECMA v5 methods).
What is a JavaScript object?
A collection of names properties, a list of key-value pairs.
What are native objects?
Objects defined by the language in the ECMA script standard, also* built-in*.
What are host objects?
Browser and document-specific objects, like the window and all DOM elements.
True or False?
There classes in JavaScript.
False.
JavaScript has only objects, which the Gang of Four favors as a general guideline: “Prefer object composition to class inheritance.”
True of False?
JavaScript has inheritance.
True.
Accomplished usually by prototypes.