Content from tayfunsen.com:
If you are programming in JavaScript, the odds are that you come from C/C++/Java background and have been bitten by the web development bug. This might cause a couple of problems however, mostly because JavaScript is "Lisp in C's Clothing". So you might find yourself a little disoriented with the familiar syntax and sometimes very unintuitive execution. One thing that is not quite so easy to understand is the fact that functions are first class in JavaScript and that they do create closures. Couple that with lexical scoping and you can get some really unexpected results.
Connected to the concept of functions being first class is the notion of variable hoisting. Dictionary definition of "hoisting" is lifting or raising something up. And this exactly what JavaScript engines do. Any variable that is declared (be it initialized to a primitive data type, an object or even a method) anywhere in a function will actually be run as if they are declared in the beginning of that function. That is, they are raised to the top of the scope they are in. Initializations for that variable will not run however, since this is not what you normally expect, and because it would have caused rather unexpected run time peculiarities.
Sunday, May 2, 2010
Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula, lorem sed cursus dignissim, nibh enim euismod tellus, nec suscipit sem libero ac mauris. Aenean faucibus turpis eget magna euismod ac fringilla lacus congue. Mauris ut est libero. In et leo sit amet purus viverra facilisis. Phasellus vel tortor sollicitudin enim pretium laoreet a id ipsum. Curabitur congue libero sed ipsum blandit iaculis. Aliquam viverra magna nec dolor vestibulum volutpat. Sed urna neque, ultrices a iaculis in, lacinia eget odio. Sed aliquam lorem ut nunc volutpat tincidunt. Mauris non enim sit amet odio dictum molestie sed ut dolor. Nam molestie nunc sapien. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras mollis odio ac lectus sagittis sed sagittis magna porta. Donec ut elementum enim. Nunc lectus purus, consequat a placerat non, tincidunt vel ipsum. Morbi non adipiscing metus. Pellentesque interdum tincidunt diam, at accumsan leo suscipit ut. Nulla rhoncus lobortis odio, in porta urna euismod vel.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris non sapien ipsum. In elementum nisi et est cursus quis semper libero commodo. Curabitur tayfun sen sodales.
In vehicula luctus nibh, eu semper neque sodales eget. Curabitur aliquam lorem tellus. Aliquam erat volutpat. Nulla venenatis semper interdum. Etiam nisl mi, feugiat dapibus lobortis sit amet, molestie ut est. Etiam ac velit vel urna lacinia viverra eget at nisl. Praesent vestibulum, diam in viverra elementum, ante tortor imperdiet sapien, commodo semper augue justo sit amet ante. Nunc orci nisl, placerat id consectetur eget, semper at nisi. Vivamus ipsum mi, mattis et fermentum et, volutpat a sapien. In hac habitasse platea dictumst.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris non sapien ipsum. In elementum nisi et est cursus quis semper libero commodo. Curabitur tayfun sen sodales.
Fusce vehicula pellentesque dictum. Maecenas posuere dolor id erat dignissim sodales. Praesent consectetur tempor vulputate. Nunc tempor nulla sed metus consequat mollis. Vivamus sed diam nec lorem posuere eleifend in eget ante. Phasellus pellentesque scelerisque nisi et accumsan.
In vehicula luctus nibh, eu semper neque sodales eget. Curabitur aliquam lorem tellus. Aliquam erat volutpat. Nulla venenatis semper interdum. Etiam nisl mi, feugiat dapibus lobortis sit amet, molestie ut est. Etiam ac velit vel urna lacinia viverra eget at nisl. Praesent vestibulum, diam in viverra elementum, ante tortor imperdiet sapien, commodo semper augue justo sit amet ante. Nunc orci nisl, placerat id consectetur eget, semper at nisi. Vivamus ipsum mi, mattis et fermentum et, volutpat a sapien. In hac habitasse platea dictumst.
Subscribe to:
Posts (Atom)