logo

Quotes from Eric Freeman

Two objects are equal only if the variables containing the object references point to the same object.
~ Eric Freeman
Lexical scope means that we can determine the scope of a variable by reading our code.
~ Eric Freeman
Closures are a function along with a referencing environment.
~ Eric Freeman
Two references are equal only if they reference the same object
~ Eric Freeman
The hasOwnProperty method returns true if a property is defined in an object instance. If it's not, but you can access that property, then you can assume the property must be defined in the object's prototype.
~ Eric Freeman
Closures are often used to capture state for event handlers.
~ Eric Freeman
concentrate on knowing what is falsey, and then everything else you can consider truthy. Let's look at some examples of using these falsey values
~ Eric Freeman
using constructors still doesn't prevent us from changing an object into something else later, because
~ Eric Freeman
That's because the default prototype for any instance you create (assuming you don't change it) is Object.
~ Eric Freeman
Yes, a car is still a car, even if you change it later.
~ Eric Freeman
JavaScript: When an event occurs, like the ones you've mentioned, that event is added to a queue. I don't even look at it until I've finished whatever I'm working on. That way I do everything correctly and safely and efficiently.
~ Eric Freeman
Composite Pattern takes the Single Responsibility design principle and trades it for transparency.
~ Eric Freeman
When you pass zero to setTimeout, you're asking JavaScript to run your timeout handler as soon as it possibly can — and this leads to your handler running as frequently as it possibly can.
~ Eric Freeman
Math is not a constructor, or even a function. It's an object. As you know, Math is a built-in object that you can use to do things like get the value of pi (with Math.PI) or generate a random number (with Math.random). Think of Math as just like an object literal that has a bunch of useful properties and methods in it, built-in for you to use whenever you write JavaScript code. It just happens to have a capital first letter to let you know that it's built-in to JavaScript.
~ Eric Freeman
An object literal is an instance of Object. Think
~ Eric Freeman
position: absolute" positions an element based on the position of its most closely positioned parent.
~ Eric Freeman
You can't send functions:
~ Eric Freeman
You can't insert new
~ Eric Freeman
JavaScript has a very powerful object model, but one that is a bit different than the status quo object-oriented language. Rather than the typical class-based object-oriented system, JavaScript instead opts for a more powerful prototype model, where objects can inherit and extend the behavior of other objects. What
~ Eric Freeman
One thing that often misleads people learning closures is that they think the environment in the closure must have a copy of all the variables and their values. It doesn't. In
~ Eric Freeman
JavaScript doesn't have a classical object-oriented model, where you create objects from classes. In fact, JavaScript doesn't have classes at all. In JavaScript, objects inherit behavior from other objects, which we call prototypal inheritance, or inheritance based on prototypes.
~ Eric Freeman
Remember, null is intended to represent an object that isn't there.
~ Eric Freeman
JavaScript creates all local variables at the beginning of a function whether you declare them or not (this is called "hoisting" and we'll come back to it later), but the variables are all undefined until they are assigned a value, which might not be what you want.
~ Eric Freeman
the truth is JavaScript actually makes two passes over your page: in the first pass it reads all the function definitions, and in the second it begins executing your code. So
~ Eric Freeman