views:

28

answers:

2

Three (out of 8 or so) of the parameters in an object have an underscore at the beginning of their name. The underscores aren't in my json object and I can't decipher why Firebug would add them in. The same properties are listed later in the object but without the underscores. I'm sure it's trivial but I'm curious to know.

Here's a screenshot:

firebug

+1  A: 

Prefixing a variable/property name with an underscore is simply a JavaScript coding convention. It usually implies that those variables are "private," or at least not meant for use by "outsiders."


There are a number of other languages which actually use underscore prefixes. For instance, two preceding underscores (__) makes a member private in Python; in C++, a single leading underscore is reserved in global namespaces (source).

Also see this question.

Matt Ball
+1  A: 

Firebug does not add underscores to variables. These underscores are already there.

johnjbarton