1

If I open a console on my browser (Firefox 43) and type keys, it returns a function: JSTH_keys().

I searched all over Google, but I couldn't find any documentation on this.

So, what is JSTH_keys()? What is it for? What does it do? What does JSTH stand for?

Braden Best
  • 8,830
  • 3
  • 31
  • 43
Phil
  • 1,897
  • 4
  • 25
  • 48
  • 2
    It's part of the [Mozilla dev tools](http://code.metager.de/source/xref/mozilla/B2G/gecko/browser/devtools/webconsole/HUDService.jsm#4651). Nothing that would be available to normal JS code, not part of a web page, etc. – Paul Roub Dec 04 '15 at 16:30
  • Thank you. I see from the source code that it appears to be a wrapper to Object.keys. Also I've found that Chrome also supports the keys function. As for the other part of my question, any idea what JSTH stands for? – Phil Dec 04 '15 at 16:38
  • 1
    [JSTermHelper](http://code.metager.de/source/xref/mozilla/B2G/gecko/browser/devtools/webconsole/HUDService.jsm#4549) – Paul Roub Dec 04 '15 at 16:39
  • Of course. So obvious now (from your first link). Thank you! – Phil Dec 04 '15 at 16:41
  • 1
    @PaulRoub Funny how despite being part of the dev tools, and not the [Document Object Model](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model) (DOM), it still breaks code, should you accidentally use it as a variable, like say, an *array*, because it doesn't let you re-define it for some reason, even though it really *ought to* since `keys` by itself is non-standard in respect to the DOM. Let's just hope they don't accidentally do this with `$`, otherwise they'll break jQuery. – Braden Best Dec 17 '15 at 17:37
  • 1
    Also, I think this is a good question, and that it doesn't deserve the downvote that it got. I think the "Google-fu" bit might have struck a nerve with someone. Call it a hunch, but I went ahead and edited the question to be more *to-the-point*. – Braden Best Dec 17 '15 at 17:48
  • 1
    If you don't want to [self-answer this](https://stackoverflow.com/help/self-answer), I'd suggest to close as a duplicate of [What is the source of the double-dollar sign selector query function in Chrome/Firefox?](http://stackoverflow.com/q/8981211/1048572) – Bergi Dec 17 '15 at 18:10

1 Answers1

1

Thanks to @PaulRoub for the answer.

JSTH stands for the JSTermHelper and is part of Mozilla's development tools. The keys function simply wraps the call to the function Object.keys which returns an array containing the names of all properties of the object.

Phil
  • 1,897
  • 4
  • 25
  • 48