logo

Quotes from Eric Freeman

By lexical scope we mean that JavaScript's rules for scoping are based purely on the structure of your code (not on some dynamic runtime properties). This means you can determine where a variable is defined by simply examining your code's structure. Also
~ Eric Freeman
To write code this way, you need to consider the events that can happen, and how your code should react. Computer science types like to say that this kind of code is asynchronous, because we're writing code to be invoked later, if and when an event occurs. This
~ Eric Freeman
No human being can tame the tongue. It is a restless evil, full of deadly poison. With it we bless our Lord and Father, and with it we curse people who are made in the likeness of God. From the same mouth come blessing and cursing. My brothers, these things ought not be so" (James 3: 8-10ESV).
~ Eric Freeman
Now, when we have an environment that has a value for each of the free variables, we say that we've closed the function. And, when we take the function and the environment together, we say we have a closure.
~ Eric Freeman
Q: Q: You said getElementsByTagName returns a list. Do you mean an array? A: A: It returns an object that you can treat like an array, but it's actually an object called a NodeList. A NodeList is a collection of Nodes, which is just a technical name for the element objects that you see in the DOM tree. You
~ Eric Freeman
Joe: What's the target? Judy: Like I said, it's the element that generated the event. Like if you click on a specific image, the target will be that image.
~ Eric Freeman
Take what varies and "encapsulate" it so it won't affect the rest of your code.
~ Eric Freeman
JavaScript: Don't judge me by my bad parts, learn the good stuff and stick with that!
~ Eric Freeman
When you design, solve things in the simplest way possible. Your goal should be simplicity, not 'How can I apply a pattern to this problem.
~ Eric Freeman
A remote proxy acts as a local representative to a remote object.
~ Eric Freeman
When you pass a primitive value it is copied into the parameter. We call this "passing by value." So if you change the value of the parameter in your function body it has no affect on our original argument's value. The exception to this is passing an array or object, and we'll get to that in a bit.
~ Eric Freeman
A function without a return statement returns undefined.
~ Eric Freeman
If a variable is declared outside a function, it's GLOBAL. If it's declared inside a function, it's LOCAL.
~ Eric Freeman
when you assign a value to a variable name that hasn't been previously declared, it is treated as a new, global variable. So be careful, if you do this within a function you are creating a global variable. Note
~ Eric Freeman
God had the ability to say whatever He desired, but He chose to speak life! Why? Because the words He spoke are the essence of who He is: Life!
~ Eric Freeman
methods in objects are properties too. They just happen to have a function assigned to them.
~ Eric Freeman
When you link to multiple JavaScript files from your page, all the global variables are defined in the same global space.
~ Eric Freeman
If you assign a new variable without using the var keyword, that variable will be global, even if you are first assigning it in a function.
~ Eric Freeman
an important thing to know about JavaScript: there's one queue and one "thread of control," meaning there is only one of me going through the events one at a time.
~ Eric Freeman
Well, say you write a handler and it requires a lot of computation — that is, something that takes a long time to compute. As long as your handler is chugging along computing, I'm sitting around waiting until it's done. Only then can I continue with the queue.
~ Eric Freeman
Booleans are named after George Boole, an English mathematician who invented Boolean logic. You'll
~ Eric Freeman
We haven't done much writing code, but we are reading and understanding code, and that can be just as good. So
~ Eric Freeman
Using a method to change a property is another example of encapsulation whereby we can often improve the maintainability and extensibility of code by letting an object worry about how it gets things done. It's
~ Eric Freeman
In fact, there's a keyword in JavaScript named this, and that is exactly how you tell JavaScript you mean this object we're in.
~ Eric Freeman