Why does firebug show some javascript objects in red?

I am trying to learn and improve my JavaScript skills.

A very useful tool is firebug, with which I can check various javascript objects.

However, I have a few questions:

  • Some object names (e.g. jQuery, $, fn, etc.) are displayed in red. Why?

  • Some other objects have a prototype property that is not in bold. What is it and when is it good or not to use / implement it?

  • Most functions are shown as "function ()". But there are other functions that are displayed, for example, as "u (M)", "z ()", "B (E)". Why are they different?

Firebug console

thanks

+4
source share
3 answers

on the firebug documentation page:

Different color codes allow you to distinguish between 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

+8
source

You might want to take a look at FirebugWiki

  Bold Red are constructor functions 
+2
source

The 'prototype' property is a built-in function that refers to the structure of an object. In JS, everything is an object, even functions, and by getting the prototype property, you can extend the object.

How does JavaScript.prototype work?

0
source

Source: https://habr.com/ru/post/1391999/


All Articles