meetar
meetar

Reputation: 7611

Mystery letters in a javascript object summary in Chrome's console

When I log a javascript object in Chrome's console, I see a list of objects:

[▶ d, ▶ d, ▶ d, ▶ p, ▶ k, ▶ k, ▶ k, ▶ k, ▶ k, ▶ k, ▶ d]

Clicking each triangle expands the object, but what do the letters mean? They don't seem to have any representation in the objects themselves.

(For reference, this is a dat.gui gui.__controllers object, and the letters seem to correspond to controller type: d = dropdown, p = silder, k = color picker. It would be handy to refer to controller by type, can I use those letters to do that?)

Upvotes: 1

Views: 389

Answers (1)

meetar
meetar

Reputation: 7611

As mentioned by commenters, those are the names of constructor functions – but in this case, those names have been inferred by Chrome's V8 engine, and assigned for your convenience in the console, as explained in this answer:

How does DevTools determine an object's constructor's name?

In all likelihood, those letters are the names assigned to the functions by the minification process, and may or may not have any relation to the functions' original unminified names.

So no, they're not accessible through the object in any handy way, because they're not official properties of the object – they're just there for your convenience, because it's nicer in the console than an array of anonymous [ Objects ].

Upvotes: 1

Related Questions