4

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

Catalin
  • 11,503
  • 19
  • 74
  • 147

3 Answers3

8

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

pleasedontbelong
  • 19,542
  • 12
  • 53
  • 77
2

You may want to have a look at the FirebugWiki

 Bold Red are constructor functions 
qiao
  • 17,941
  • 6
  • 57
  • 46
0

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?

Community
  • 1
  • 1
r00pert
  • 101
  • 1
  • 2