Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why firebug shows some javascript objects in red color?

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:

  1. Some object names (like jQuery, $, fn etc.) are displayed in red color. Why?

  2. 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?

  3. 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?

Firebug Console

Thank you

like image 924
Catalin Avatar asked Dec 28 '22 07:12

Catalin


2 Answers

from 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

like image 200
pleasedontbelong Avatar answered Jan 13 '23 07:01

pleasedontbelong


You may want to have a look at the FirebugWiki

 Bold Red are constructor functions 
like image 43
qiao Avatar answered Jan 13 '23 06:01

qiao