Quotes About Programming
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
BazillionQuotes.com
So, we recommend specifying the width and height in the tag attributes, and not setting those properties in CSS unless you really mean to scale the canvas.
~ Eric Freeman
BazillionQuotes.com
Yes, workers can access localStorage and make XMLHttpRequests.
~ Eric Freeman
BazillionQuotes.com
If the two values have different types, try to convert them into the same type and then compare them
~ Eric Freeman
BazillionQuotes.com
When you delete a property, you're not just deleting the value of the property, you're deleting the property itself. And, if you try to use fido.dogYears after deleting it, it will evaluate to undefined.
~ Eric Freeman
BazillionQuotes.com
An expression is anything that evaluates to a value. 3+4
~ Eric Freeman
BazillionQuotes.com
Here's the short story: functions are objects in JavaScript. In
~ Eric Freeman
BazillionQuotes.com
in JavaScript just about everything is an object underneath, even
~ Eric Freeman
BazillionQuotes.com
the constructor always has a prototype property. More
~ Eric Freeman
BazillionQuotes.com
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
BazillionQuotes.com
Take what varies and "encapsulate" it so it won't affect the rest of your code.
~ Eric Freeman
BazillionQuotes.com
A function without a return statement returns undefined.
~ Eric Freeman
BazillionQuotes.com
If a variable is declared outside a function, it's GLOBAL. If it's declared inside a function, it's LOCAL.
~ Eric Freeman
BazillionQuotes.com
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
BazillionQuotes.com
methods in objects are properties too. They just happen to have a function assigned to them.
~ Eric Freeman
BazillionQuotes.com
When you link to multiple JavaScript files from your page, all the global variables are defined in the same global space.
~ Eric Freeman
BazillionQuotes.com
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
BazillionQuotes.com
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
BazillionQuotes.com
We haven't done much writing code, but we are reading and understanding code, and that can be just as good. So
~ Eric Freeman
BazillionQuotes.com
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
BazillionQuotes.com
A callback works like this: give a function to the object that knows about the event. When the event occurs, that object will call you back, or notify you, by calling that function. You're going to see this pattern in JavaScript for a variety of events.
~ Eric Freeman
BazillionQuotes.com
As it turns out, one of the things the new operator does behind the scenes when the object is created is to store information that allows it to determine, at any time, the constructor that created the object. And
~ Eric Freeman
BazillionQuotes.com
When you declare any kind of global variable or define a global function, it is stored as a property in the window object. So
~ Eric Freeman
BazillionQuotes.com
You see, now that we have a prototype, if we add any methods to that prototype, even after we've already created dog objects, all dogs inheriting from the prototype immediately and automatically get this new behavior.
~ Eric Freeman
BazillionQuotes.com
