I am trying to learn and improve my javascript skills.
A very helpful tool is firebug, with which i can inspect different javascript objects.
However, i have some questions:
Some object names (like jQuery, $, fn etc.) are displayed in red color. Why?
Some other objects has a "prototype" property, which is not in bold. What is that and when is good or not to use/implement it?
Most of functions are shown as "function()". But there are also some other functions which are displayed, for example, as "u(M)", "z()", "B(E)". Why they are different?
Thank you
I am trying to learn and improve my javascript skills.
A very helpful tool is firebug, with which i can inspect different javascript objects.
However, i have some questions:
Some object names (like jQuery, $, fn etc.) are displayed in red color. Why?
Some other objects has a "prototype" property, which is not in bold. What is that and when is good or not to use/implement it?
Most of functions are shown as "function()". But there are also some other functions which are displayed, for example, as "u(M)", "z()", "B(E)". Why they are different?
Thank you
Share Improve this question edited Jan 20, 2012 at 9:09 Catalin asked Jan 20, 2012 at 8:22 CatalinCatalin 11.7k19 gold badges80 silver badges152 bronze badges 1- Please, add images to your post. – c69 Commented Jan 20, 2012 at 8:55
3 Answers
Reset to default 8from the documentation page of firebug:
Different color codes let you distinguish between the different types of variables and improve readability. Here they are in detail:
Format Description
Bold Black Objects
Black DOM objects
get in gray "Getter" functions
Bold green User functions
Green DOM functions
Bold Red Constructor functions
Hope this helps
You may want to have a look at the FirebugWiki
Bold Red are constructor functions
The 'prototype' property is a built-in feature that links to the structure of the object. In JS everything is an object, even functions, and by accessing the prototype property you can extend the object.
How does JavaScript .prototype work?